Start devServer dual-stack by default#13235
Conversation
|
Hi @LouisMT! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
The default
hostfor Webpack'sdevServeris currently0.0.0.0. So we can reach our project onhttp://localhost:3000, but only over IPv4!For browsers this isn't really a problem, as they fall back to IPv4 automatically. But other clients usually don't have such a fallback, and as more operating systems/frameworks will default to IPv6, this will cause problems.
By using
::instead of0.0.0.0, the server will be available on both IPv4 and IPv6 by default.I've tested this change locally, and the Node.js docs mention that dual-stack support is the default behaviour when using
::. But more testing might be needed.A little more context: I ran into this issue because I'm using
setupProxyto access my GraphQL API through thedevServer. So I rangraphql-codegenagainsthttp://localhost:3000/graphql, and it tries to connect using IPv6.