Access web server on macOS from iOS

I have a development web server running on my macbook air (M1 2020, mac OS 14.6.1). It's LAN IP is 192.168.1.196, the server runs on port 3000.


I have an old mac mini (2012, mac OS 10.15.7). When I open "http://192.168.1.196:3000" in a browser, I access my dev server without problems.


When I try to access from iOS devices, with safari or chrome browsers, it fails (ERR_CONNECTION_FAILED). I tried with an iPad (iOS 17.6.1), and with 2 iPhones (iOS 17.7.1 and 17.6.1). It fails on all.

Of course, all the devices are on the same local network (wifi), I don't use private relay, I don't use any proxy.

Everything was working in mars (last time I developed with this macbook air).


I also try to ping the macbook air. Same scenario : it works from the mac mini, not from iOS devices (I used a ping app, I granted local network access to it).


Any idea ? This is really slowing down my development as I can't test my site on real mobile devices…


Regards.

iPhone SE, iOS 17

Posted on Nov 10, 2024 3:19 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 10, 2024 3:49 PM

If you can’t ping, then your IP network or IP routing is likely misconfigured.


If you have more than one Wi-Fi router — your ISP gateway box, and one or more added routers or added Wi-Fi routers — you’ll either need to switch to access points, or switch to IP subnets for each routed segment.


If there are any VPN apps installed here, or any add-on security apps or services, remove all of them, restart, and check again. This on both client and server.


Check for firmware updates for the Wi-Fi router too, and update to the latest available. If no updates, restart the Wi-Fi router.


if you can (eventually) gain access and can ping (eventually), check the web server logs, and port-scan the server using a computer able to run nmap or otherwise.


If running Apache, check the configuration:

apachectl configtest


Can’t get Apache going? Shut it off, and try MAMP.


{This isn’t an app development question. It’s seemingly a networking question, or maybe a macOS Server question.}

4 replies
Question marked as Top-ranking reply

Nov 10, 2024 3:49 PM in response to fenykepy

If you can’t ping, then your IP network or IP routing is likely misconfigured.


If you have more than one Wi-Fi router — your ISP gateway box, and one or more added routers or added Wi-Fi routers — you’ll either need to switch to access points, or switch to IP subnets for each routed segment.


If there are any VPN apps installed here, or any add-on security apps or services, remove all of them, restart, and check again. This on both client and server.


Check for firmware updates for the Wi-Fi router too, and update to the latest available. If no updates, restart the Wi-Fi router.


if you can (eventually) gain access and can ping (eventually), check the web server logs, and port-scan the server using a computer able to run nmap or otherwise.


If running Apache, check the configuration:

apachectl configtest


Can’t get Apache going? Shut it off, and try MAMP.


{This isn’t an app development question. It’s seemingly a networking question, or maybe a macOS Server question.}

Nov 11, 2024 8:34 AM in response to fenykepy

I think my network is well configured, else I couldn't access it from the mac mini.


IP hosts use different paths for packets routing from local to remote, and any packets returning in response from remote to local can use (or can fail to use) completely different network paths.


There can also be differences in offered or required TLS on client and on server.


Multiple IP routers (without either VLANs or isolated segments, or subnets, or static routes) can also get IP routing tangled.


So too can a buggy router, and some cheap Wi-Fi routers can be quite buggy. Restarts can sometimes help, firmware updates too, or replacement with a reputable and newer Wi-Fi router.


Questions:


  • Any VLANs configured?


  • Any subnet routing configured?


  • More than one IP router present?


  • nmap port scan of the Mac mini from another host that can connect? (Are the ports you expect open actually open?)


nmap -p 1-65535 [host target]


It is possible to use s_client or another tool, or can narrow the range for nmap scan. I’d leave the nmap scan settings wide initially, to see what else is running on the target host, and that, the rest of the host is as expected.


  • Anything in the logs of the not-Apache HTTP/HTTPS server here?

Nov 11, 2024 1:08 AM in response to MrHoffman

Thanks for your replies!


I think my network is well configured, else I couldn't access it from the mac mini.


I don't use apache, as it's for development purposes only. I use integrated development servers (nextjs, react-scripts, nodejs). They run on different ports (8080, 3000, 4000, etc.).


I also have a linux small file server on my LAN. I made a test with it this morning. If I run the dev server on it, I access from iOS and macOS devices.

So it must be some configuration on the iOS devices that blocks, or something on the macbook air configuration that the iOS devices don't like. But what ? The mac mini must be more permissive as it's older.


Macbook air configuration (macOS 14.6.1, running dev server):

wifi: FREEBOX_YG2345
IP Address: 192.168.1.196
Router: 192.168.1.254
DNS (automatic): 192.168.1.254
Limit IP Address Tracking: off
Low Data Mode: off
Proxy: off
VPN: off
Private Relay: off
Firewall: on (tried with off, doesn't change anything)
Stealth mode: off


iPad configuration (iOS 17.6.1, client):

wifi: FREEBOX_YG2345
IP Address: 192.168.1.190
Router: 192.168.1.254
DNS (automatic): 192.168.1.254
Limit IP Address Tracking: on (tried with off, doesn't change anything)
Private Wifi Address: off
Low Data Mode: off
Proxy: off
VPN: off
Private Relay: off

Privacy and Security -> Local Network: Chrome and Ping app allowed (no widget for Safari).


Maybe something else I didn't think about is relevant?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Access web server on macOS from iOS

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.