On a Raspberry PI I have, whatever I run on, say, http://localhost:8080
, is automatically visible to other computers on my local network at http://192.168.0.xxx:8080
or http://pi.local:8080
.
This doesn't happen with my Mac. If I'm testing an Angular app which runs on http://localhost:4200
, that app will not be seen at http://mymac.local:4200
by other computers on my local network.
All I want to do is expose the localhost port to my LAN, not to the rest of the world. Yet when I look for a solution to this problem, all I turn up is tools like ngrok
, which isn't what I want. I'm not trying to have my app visible to the whole world, just my LAN.
My macOS firewall is not turned on, so there is not a problem as far as I know with the particular port being actively blocked.
UPDATE:
A make-shift solution I have found is this:
browser-sync start --proxy "localhost:4200" --no-open --no-ghost-mode --no-notify --no-snippet --no-ui --port 4200
browser-sync
, however, is specifically HTTP oriented, and tries to mess around with the contents which are served in many way, hence all of the --no-xxx
flags I'm using. I'd like to find a similar, simpler solution that forwards TCP traffic in a purely neutral way.