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

[Miniflare 3] Use localhost instead of 127.0.0.1 for loopback hostname #615

Merged
merged 1 commit into from
Jun 27, 2023

Commits on Jun 27, 2023

  1. 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
    mrbbot committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    dbfe5d9 View commit details
    Browse the repository at this point in the history