Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable debugging for any address #109

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/scala/spray/revolver/DebugSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package spray.revolver

case class DebugSettings(port: Int = 5005, suspend: Boolean = false) {
def toCmdLineArg: String =
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=%s,address=%d".format(b2str(suspend), port)
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=%s,address=*:%d".format(b2str(suspend), port)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, would this open the port on 0.0.0.0?

If you'd do that on your host system, it'd mean the port would be open for anyone who can connect to it. I expect the debugging interface allows arbitrary code execution, so perhaps this should be an opt-in option instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I've updated the code to have it as an optional parameter


private def b2str(b: Boolean) = if (b) "y" else "n"
}