microsoft / microsoft/java-debug

Feature Request: Allow specifying the address when binding to a port

Ouverte
#378 1 commentaire 2 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

ai-triaged enhancement
Langage dominant
Java
Étoiles
409
Forks
204
Merge moyen
1 j 13 h
PR mergées (30 j)
4

Description

When opening a Java debugging session in my local machine, I'd prefer to be able to have the TCP port that the debug server will bind to in the loopback interface instead of in all of them, mostly out of paranoia when I'm working on a shared WiFi.

Also (and maybe less interesting to other folks), at replit.com, we detect TCP ports bound to 0.0.0.0 and treat them magically as web servers, so this should also prevent opening a debug session causing an unintended web server from being "deployed".

So I would like for it to be specify what interface and/or port the JavaDebugServer should bind to. Since the JavaDebugServer is a singleton, it might make sense to configure this through a system property (since sending this configuration in the initialize message may not have the intended effect if the LSP process had already spawned one JavaDebugServer instance). So something like

$ java \
        -Declipse.application=org.eclipse.jdt.ls.core.id1 \
        -Dosgi.bundles.defaultStartLevel=4 \
        -Declipse.product=org.eclipse.jdt.ls.core.product \
        -Dcom.microsoft.java.debug.serverAddress=localhost:12345 \  # <- a brand new property
        -noverify \
        -Xmx256m \
        -jar ../jdt/plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar \
        -configuration ../jdt/config_linux \
        -data /home/runner/JavaDAP \
        --add-modules=ALL-SYSTEM \
        --add-opens', 'java.base/java.util=ALL-UNNAMED \
        --add-opens', 'java.base/java.lang=ALL-UNNAMED

should do the trick.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par localiser JavaDebugServer et le code qui lie son serveur de débogage TCP, puis examinez la manière dont les propriétés système au lancement sont gérées. Le travail est terminé lorsque le serveur de débogage peut être configuré avec une interface et un port demandés, y compris loopback, sans perturber son comportement de démarrage existant.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
devtools, networking
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
28/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.