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

Support customising the inspector IP #5603

Open
AndrewJDR opened this issue Apr 12, 2024 · 1 comment
Open

Support customising the inspector IP #5603

AndrewJDR opened this issue Apr 12, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@AndrewJDR
Copy link

Which Cloudflare product(s) does this pertain to?

Workers Runtime, Wrangler core, Miniflare

What version(s) of the tool(s) are you using?

Wrangler 3.50.0

What version of Node are you using?

v20.11.1

What operating system and version are you using?

Debian Bookworm

Describe the Bug

Observed behavior

Even when specifying wrangler dev --ip 0.0.0.0, the inspector only listens on 127.0.0.1 and there does not appear to be any additional flags to force the inspector to bind to any IP other than the loopback.

Expected behavior

There should be some way to for the inspector to bind to non-loopback addresses. This is important when running wrangler inside of a docker container, where port exposure works by forwarding the container's internal socket (e.g. 172.40.40.11:9223) to some host socket e.g. 192.168.1.77:1234. It's not possible to forward a container's loopback address.

In some sense, this is a regression caused by #4437
It's totally understandable for the inspector to listen only on loopback by default, but it's a bummer that there is now no way to have it listen on non-loopback addresses.

Steps to reproduce

Just run wrangler dev and observe that there is no way to have the inspector bind to anything other than loopback. Specifying --ip 0.0.0.0 does not seem to allow this, either.

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@AndrewJDR
Copy link
Author

As a workaround, I'm currently using the sed command below in a postinstall script in package.json of any project that uses wrangler. It forces the inspector to bind to the wildcard address (0.0.0.0). Definitely not ideal though.

sed -i 's~port: props.inspectorPort$~port: props.inspectorPort, hostname: "0.0.0.0"~g' ./node_modules/wrangler/wrangler-dist/cli.js

@penalosa penalosa added the enhancement New feature or request label Jul 22, 2024
@penalosa penalosa changed the title 🐛 BUG: It does not seem possible to have the inspector listen on non-localhost IP Support customising the inspector IP Jul 22, 2024
@penalosa penalosa moved this from Untriaged to Backlog in workers-sdk Jul 22, 2024
@penalosa penalosa removed the bug Something that isn't working label Sep 23, 2024
@penalosa penalosa removed this from workers-sdk Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants