microsoft / microsoft/java-debug
Feature Request: Allow specifying the address when binding to a port
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 409
- Forks
- 204
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating JavaDebugServer and the code that binds its TCP debug server, then inspect how launch-time system properties are handled. Done means the debug server can be configured with a requested interface and port, including loopback, without breaking its existing startup behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100