Skip to content

Port forwarded from ASGI server in devcontainer hangs on connection #10912

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

Open
mongj opened this issue Apr 25, 2025 · 0 comments
Open

Port forwarded from ASGI server in devcontainer hangs on connection #10912

mongj opened this issue Apr 25, 2025 · 0 comments
Assignees
Labels
containers Issue in vscode-remote containers

Comments

@mongj
Copy link

mongj commented Apr 25, 2025

I am running the following set up:

  1. Running FastAPI server in a devcontainer via uvicorn src.main:app --reload --host 0.0.0.0 --port 13337
  2. Forward the port using vscode's built-in port-forwarding feature, to localhost:13337

Observation:

  1. curl http://127.0.0.1:13337 within the devcontainer returns the correct response
  2. curl http://localhost:13337 from my local machine (outside the devcontainer) hangs

What I've tried:

  1. Removing the --reload flag solves the issue. Similarly, setting --workers 1 also solves the issue. And --workers n for n > 1 results in the same issue
  2. Same issue observed when running the FastAPI server with other ASGI web servers like hypercorn

Wanted to find out if this is a known issue and why this might be happening?

@vs-code-engineering vs-code-engineering bot added the containers Issue in vscode-remote containers label Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers
Projects
None yet
Development

No branches or pull requests

2 participants