Local development certs for LAN https services.
Localhost exposes local insecure http services as fully encrypted https available at svc.host
Homebrew (auto updates)
brew install sprisa/tap/localhost npm i -g @sprisa/localhost
# or run directly
npx @sprisa/localhost 3000 -aGolang Source
With Go (Any platform — doesn't auto update)
go install github.com/sprisa/localhost@latestlocalhost 3000Navigate to the https service at https://local.svc.host:5050
localhost 3000 -alocalhost 3000 -p 3001localhost --help1. Many Javascript APIs are only available in secure contexts (aka https). This makes local development harder than it should be.
- For example the Crypto API. This list of restricted APIs is only growing.
- Some browser contexts, like iOS Webviews, refuse to load insecure webpages.
- iOS will not make api requests to insecure APIs (http) when the development app is running on a remote device.
- Localhost makes it easy to share your service on your Mesh Network IP.
- Remote development without needing to be on the same LAN network when using a mesh network like
Priv NetworkorTailscale
svc.host is a DNS server which replies with your local WAN IP. It allows the https (tls) certificates to be trusted by your browser.
Hostnames are in the form [ip-address].svc.host, with the IP's dot seperator (.) being replaced with a dash (-) instead.
dig 192-168-1-180.svc.host => 192.168.1.180
dig 10-10-10-10.svc.host => 10.10.10.10
dig local.svc.host => 127.0.0.1
Only private IP ranges are supported.
- localtls - https://github.com/Corollarium/localtls
- sslip.io - https://sslip.io/
localhost is not a tunnel for the public internet. It connects any devices that are already on the same subnet, such as LAN or a mesh VPN. If you need an internet tunnel check out anderspitman/awesome-tunneling.
