microsoft / microsoft/vscode-remote-release

Port forwarded from ASGI server in devcontainer hangs on connection

Open
#10,912 0 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

bug containers remote-explorer
Dominant language
Dockerfile
Stars
4.2k
Forks
469
Avg merge
1d 1h
Merged PRs (30d)
1

Description

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?

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.