Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
localhost
instead of 127.0.0.1
for loopback hostname
Miniflare starts its loopback server on the same host as the `workerd` server, so it's accessible on all the same addresses as the runtime. This allows the loopback server to be the target for the live reload web socket. This means if the `host: "localhost"` option is set, we start a Node `http` server with `localhost` as the hostname. Node will perform a DNS lookup to work out which IP address and interface to listen on, but will only listen on the first entry. In Node 17+, this will be the IPv6 interface. Unfortunately, we previously hardcoded the loopback address as the IPv4 loopback, meaning `workerd` was unable to connect. This change switches to using `localhost`, which `workerd` will resolve to either IPv4 or v6. Closes cloudflare/workers-sdk#3515
- Loading branch information