microsoft / microsoft/java-debug

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

Aperta
#378 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

ai-triaged enhancement
Lingua principale
Java
Stelle
409
Fork
204
Merge medio
1g 13h
PR unite (30g)
4

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia individuando JavaDebugServer e il codice che associa il suo server di debug TCP, quindi esamina come vengono gestite le proprietà di sistema al momento dell'avvio. Il lavoro è completato quando il server di debug può essere configurato con un'interfaccia e una porta richieste, incluso loopback, senza compromettere il comportamento di avvio esistente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
devtools, networking
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
28/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.