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

A way to serve to 0.0.0.0? #866

Closed
romanoff opened this issue Feb 21, 2021 · 1 comment
Closed

A way to serve to 0.0.0.0? #866

romanoff opened this issue Feb 21, 2021 · 1 comment

Comments

@romanoff
Copy link

It could be useful during development together with using Tailscale for example. Otherwise static resources are returned from localhost, but are not returned from public ip address

@evanw
Copy link
Owner

evanw commented Feb 23, 2021

From the documentation:

  • host

    The web server is only available on the internal loopback address by default. This is deliberate behavior for security reasons, since the local network environment may not be trusted. However, it can be useful to run the web server on a different address when developing with esbuild inside of a virtual machine/docker container, or to request development assets from a remote testing device on the same network at a different IP address. To do that you need to specify the host here. You can set the host on the command line by using --serve=192.168.0.1:8000 instead of just --serve.

Specifying 0.0.0.0 using --serve=0.0.0.0:8000 should work fine.

I might change --serve to default to 0.0.0.0 instead of 127.0.0.1 though since it's a common thing to develop on e.g. a mobile device. You would still be able to do a local-only server with --serve=127.0.0.1:8000 anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants