I'm building a website on my laptop. To see how it renders, I serve it locally on port 80 with lighttpd. I can then open it in my laptop's browser via any IP or URL referring to the laptop http://localhost or http://192.168.1.47 (IP on the local subnet) or http://coulomb (its hostname) . Fine.
Now I want to test its responsive design, so I try to open the laptop address in my phone's browser: http://192.168.1.47 or http://coulomb. Both devices (phone and laptop) are in the 192.168.1.* subnet of my Wifi DSL box. Strangely to me, the phone's browser (be it Firefox or Chrome) "rephrases" the IP into "localhost". The connexion then fails with a "site unreachable"-like error.
lighttpd is not the culprit. To check this I instead served the files of some directory of the laptop with sudo ruby -run -ehttpd . -p80, the behavior is the same.
There is something with the port. If I serve the website on port 3000 (as shown in lighttpd docs) or 8000 or 8080 it works: the phone's browser opens 192.168.1.47:3000 (or :8000 or :8080) and I see the website.
The phone seems not to be the culprit either: I can open the HTTP interface of the DSL box at 192.168.1.1, default port, without problem. (If asked to, I might try and use a computer client instead of the phone, but it's not easy for practical reasons.)
If you wonder why I insist on serving it on port 80: it is built with Wordpress, and doesn't work right on a custom port, the plain text is shown but no css or images are loaded. I don't want to workaround the problem by tweaking Wordpress to make it custom-port-compatible, because when the site is ready I'll mirror it to a public server.