microsoft / microsoft/java-debug

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

Offen
#378 1 Kommentar 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

ai-triaged enhancement
Vorherrschende Sprache
Java
Sterne
409
Forks
204
Ø Merge
1 T. 13 Std.
Gemergte PRs (30 T.)
4

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, JavaDebugServer und den Code zu finden, der seinen TCP-Debug-Server bindet, und untersuche anschließend, wie System-Properties zur Startzeit verarbeitet werden. Fertig ist die Aufgabe, wenn der Debug-Server mit einem angeforderten Interface und Port konfiguriert werden kann, einschließlich Loopback, ohne sein bestehendes Startverhalten zu beeinträchtigen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
devtools, networking
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
28/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.