spinframework / spinframework/spin

Debug server port forwarding

Open
#3,153 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
6.5k
Forks
310
Avg merge
1d 20h
Merged PRs (30d)
24

Description

Summarizing @itowlson's description of the problem:

https://github.com/bytecodealliance/StarlingMonkey/pull/218 started adding support for running a JS debugger in the guest, which requires that the debugger be able to make an outbound socket connection to a debug server (typically on localhost). Spin's allow_outbound_hosts security mechanism makes this somewhat awkward in practice, because a developer would need to either always allow connections to some local port (whether actively debugging or not) or would have to e.g. edit the spin.toml while debugging, which is annoying and error prone.

My proposal (originally here):

  • Pick a domain namespace like *.spin-debug.alt (.alt is a TLD reserved for this sort of thing)
  • Configure debugger(s) to point at fixed address(es), e.g. js.spin-debug.alt:9229
  • Teach spin up a new flag like --debug-server js=127.0.0.1:9229
  • Spin resolves js.spin-debug.alt to some appropriate reserved IP internally and forwards guest connections to that IP to the configured matching --debug-server (note js from the --debug-server value above)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the spin up command and its allow_outbound_hosts handling; the issue does not name specific files or tests. Review how guest outbound connections are resolved, then verify that a --debug-server mapping supports the proposed debug namespace and forwards connections to the configured local address.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
cli, devtools, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.