Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
One recent frustration I ran into with Node's DNS is that it doesn't seem to resolve whatever.localhost to 127.0.0.1, unlike my browser.
Not entirely sure which is doing the right thing by the spec here, but I much prefer the browser behavior, because I would really like to not have to add a hosts entry for everything I reverse proxy from Caddy for doing local HTTPS/HTTP2 development, for production parity.
Oh, and I also found out that Node also isn't able to use the system-wide certs store (which local HTTPS in Caddy adds to) [1], so in the end even adding a hosts entry didn't work, and I had to revert to plaintext HTTP1. Deno is looking more attractive every day [2].
Really curious to hear how other folks are doing local HTTPS/HTTP2 setups in node these days.
[1] https://github.com/nodejs/node/issues/3159
[2] https://github.com/denoland/deno/pull/11491
One recent frustration I ran into with Node's DNS is that it doesn't seem to resolve whatever.localhost to 127.0.0.1, unlike my browser.
Not entirely sure which is doing the right thing by the spec here, but I much prefer the browser behavior, because I would really like to not have to add a hosts entry for everything I reverse proxy from Caddy for doing local HTTPS/HTTP2 development, for production parity.
Oh, and I also found out that Node also isn't able to use the system-wide certs store (which local HTTPS in Caddy adds to) [1], so in the end even adding a hosts entry didn't work, and I had to revert to plaintext HTTP1. Deno is looking more attractive every day [2].
Really curious to hear how other folks are doing local HTTPS/HTTP2 setups in node these days.
[1] https://github.com/nodejs/node/issues/3159
[2] https://github.com/denoland/deno/pull/11491
> Curious how you set that up?
Via a DNS server we run, that then answers for local things or forwards requests on to the real world.
To do that locally, set up a DNS forwarder like dnsmasq [0] or unbound [1] (or coredns/bind/etc) to respond for the domain you want to wildcard to localhost. Point your OS DNS settings to 127.0.0.1, then configure the forwarder with your regular external DNS servers.
The equivalent to `NODE_USE_SYSTEM_CERTS` is a build time option unfortunately. I know the rhel/debian packages do integrate their builds with the system CA's but those packages tend to be ancient. Maybe try the nodesource [2] packaged node.js? The homebrew node formulae [3] looks like it integrates with the brew openssl CA's.
[0] https://stackoverflow.com/a/22551303
[1] https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound...
[2] https://github.com/nodesource/distributions
[3] https://github.com/Homebrew/homebrew-core/blob/c2579d98415bd...
> Curious how you set that up?
Via a DNS server we run, that then answers for local things or forwards requests on to the real world.
To do that locally, set up a DNS forwarder like dnsmasq [0] or unbound [1] (or coredns/bind/etc) to respond for the domain you want to wildcard to localhost. Point your OS DNS settings to 127.0.0.1, then configure the forwarder with your regular external DNS servers.
The equivalent to `NODE_USE_SYSTEM_CERTS` is a build time option unfortunately. I know the rhel/debian packages do integrate their builds with the system CA's but those packages tend to be ancient. Maybe try the nodesource [2] packaged node.js? The homebrew node formulae [3] looks like it integrates with the brew openssl CA's.
[0] https://stackoverflow.com/a/22551303
[1] https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound...
[2] https://github.com/nodesource/distributions
[3] https://github.com/Homebrew/homebrew-core/blob/c2579d98415bd...
problem: systemd-resolved fails randomly: https://github.com/systemd/systemd/issues/19118
- this happened to me on two arch linux installations for different domains - I was unable to debug this - would love to somehow get this fixed but I switched to dnsmasq that works fine for me.
Related posts
- Run a Linux Distro in your Android device
- I have created a small anti-depression script
- Connect OpenAI with external APIs with Function calling
- JavaScript Standard Input/Output: Unspecified
- Node.js codebase is still entirely in Javascript and not in Typescript and node team does not even officially provide node TS types