← Back to Forum
2
Setup & Configuration
LocaltoNet reserved subdomain + hosts file for same hostname in local and public testing
I set aside a LocaltoNet HTTP address, then pointed that same app hostname at my local reverse proxy in hosts so the app opens under the same name whether I'm testing locally or exposing it publicly. That got rid of a lot of annoying little mismatches with cookies, redirect URIs, and basic auth prompts.
So far it feels simpler than bouncing between localhost, random tunnel URLs, and whatever the public callback expects. If you're doing something cleaner for this, especially without dragging in a full internal DNS setup, I'd like to hear it.
Comments (3)
Use a wildcard local cert for that hostname too, that was the piece that stopped the last bit of friction for me. Keeping the name the same helped, but once I made local HTTPS match the public host I stopped tripping over secure-only behavior and mixed browser state between http and https.
Yep, matching the hostname and scheme is the part that makes a bunch of weird auth stuff finally behave. I ended up doing split-horizon DNS on my router later, but before that the hosts file approach was honestly the least annoying option for one or two apps. Have you run into any pain with mobile testing though, that's where my nice tidy setup usually falls apart.
Mobile is exactly where this starts getting fiddly for me too. I usually cave and add a DNS override on the firewall for just that hostname so phones hit the local proxy on Wi-Fi, because keeping hosts entries in sync across devices feels way too easy to mess up.
Please log in to post a comment.