Can't access localhost on MacBook from iPhone Safari, shows loading bar then fails? - iphone

I have a nodejs server running on port 3000 and I'm trying to access that from my iPhone.
I have tried:
The Macs IP Address (found in "network")
The Macs "name" (computer-name.local:3000)
Changing the WLAN
Opening "Internet Sharing" in "Sharing" unter System preferences
Accessing the site through chrome
Tested another iPhone than mine, same result as you can see on the picture
Tested an XAMPP Server on port 80, same result as you can see on the picture
Checked firewall (it's deactivated)
You can see on the image that there is indeed a loading bar, it doesn't directly show "site not found" or anything. So what I am guessing is that I have to configure something more on my MacBook, but I can't find out what. I tried everything written in other posts about this. The final message I get(after like 20 seconds) is "Safari could not open the page because the server stopped responding".

Have you checked firewall settings? Perhaps you need to open the port or the server application in System & Preferences -> Security and privacy -> Firewall -> Firewall Options.

Related

View localhost from Iphone using MacBook Pro

So I am attempting to view my localhost from my Mackbook on my iPhone. I am attempting to do so through USB connection with developmental modes on in Safari in both devices. I've tried to connect to localhost 2 ways so far with no success:
First I've opened up my System Preferences on my MacBook. I opened up the sharing option. Then I clicked "Internet Sharing" toggle on the left. I noted my computer name and clicked the option "iPhone USB." I then navigated to <cpuname>.local:4200, with 4200 being the port I'm using in for localhost. This has Safari saying that it cannot reach the server.
Second I opened a terminal and typed "ifconfig" to find my CPU IP address. I then attempted to navigate to my localhost from my phone using <cpuip>:4200 This also failed with Safari saying that it could not connect to the server.
I have done no other configurations and am interested in hearing what I should do. Any help would be greatly appreciated.
Extra Info
The application is a simple Angular application.
Both devices are connected to the same network.
For anybody suffering this problem, I've found a solution using the hint from this link here. The solution was to bind the host to port 0.0.0.0. In the Angular 2+ way, that would mean serving the app with the --host 0.0.0.0 --disableHostCheck flags. Good luck!

Why can't I enter the url on my phone's browser to view my live site?

I use an extension called Live Server in Visual Studio Code. When I run live, the browser opens and the url is http://127.0.0.1:5500/index.html. Why can't I open this url on my phone's browser to see the live site on the phone. Is there a way to do this (Live reload on phone and browser)?
Note: I also develop using ionic and when I ionic serve I can see it on browser and when I open the ionic dev app (not ionic view!), I can see the live app on the phone. I can view it on multiple devices with the condition of all devices being in the same network which I am fine with.
127.0.0.1 is a special-purpose IPv4 address reserved for loopback purposes. That is, this IP refers to your computer itself.
By entering http://127.0.0.1:5500/index.html in your browser, you're requesting web page within your computer.
In normal case, your computer will be in a NAT network (under same wi-fi AP for instance), and you'll be assigned with a virtual IP. Normally it's 192.168.x.x.
You may enter the following command in your command prompt to see your IP address.
ipconfig
If you're using Mac or Linux, use this instead.
ifconfig
As a result, under your network interface card, you'll get your IP Address.
If the IP address belongs to virtual IP, then you may access it with your phone using
http://< Your IP Address >:5500/index.html
If it's not virtual IP, it is Public IP. Then, you'll have to configure appropriate Firewall settings under this circumstance.
Hope this will help.
You cannot open the same url on your phone, because that url host (127.0.0.1) refers to the localhost (the same machine).
If your phone and server are on the same network, you can replace the current host with the servers local IP.
So if your servers local IP is: 192.168.0.36
the URL you enter in your phone should be http://192.168.0.36:5500/index.html.
I had a same problem.
Solution: Control Panel -> Windows Defender Firewall -> Allow an app or feature through Windows Defender Firewall -> Allowed "code.exe" app.
Run ipconfig and find your private IP.
Make sure your phone is on the same network.
go to http://192.168.0.***:5500/
Open Live server's settings.json and add these two settings "liveServer.settings.useLocalIp": true and "liveServer.settings.host": "localhost". Then type your localhost ip in your mobile browser (in my case it was 192.168.0.110) with the rest of the Live server URL i.e. 192.168.0.110:5500/index.html. This worked for me.
Let me clear this out for you. we call localhost or 127.0.0.1 as loop backs. which will itself point to the same machine(means that particular service should also be hosted in the same machine). what Microsoft did with visual studio live share is that if have the live share extension it will create a reverse proxy between the host(where the server is hosted) and the target (In this case your browser) which means even though your host is in a different country the extension will tunnel the transparent proxy to your loop-back address. visual studio live share extension is what you phone doesn't have and Microsoft doesn't support yet. If you still want to access your local service what you can do is turn off the firewall(or pass through that particular port where ur service is hosted) and connect your phone to the same network as your machine with the service running and instead using http://127.0.0.1:5500/index.html use http:// UR SERVER IP :5500/index.html you can get UR SERVER IP by giving ipconfig in windows command prompt or ifconfig if ur server is on linux.

Fiddler 4-iOS 10.2.1 cannot reach internet after configure proxy

I am following this instruction http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/ConfigureForiOS. Everything works until section Set the iOS Device Proxy.
Once I set the proxy on my iPhone, I can't connect to the internet from the phone anymore. Not even accessing the echo page, which I could access before turning on the proxy on the phone. I already installed the root cert on my phone, the makecert add-on on Fiddler
Could someone help with ideas to diagnose the issue here? Thanks,
What might be stopping your iphone from reaching your Fiddler machine on the port specified, usually 8888?
Have you a firewall on the Fiddler machine? You might need to open
the port.
Does your LAN have an automatic redirect to a login page? Ours
does, so I have to disable the proxy on the iphone while I login,
then reenable it.
Does your LAN expose the IPs of cable-connected machines to WIFI
users? Not all do.
Can you browse a simple web page on your Fiddler machine from your
iphone, before starting fiddler or doing any proxy configuration?
You might need to get really serious and install a ping utility on the iphone.

Fiddler not capturing traffic. Proxy settings keep getting changed

A few days ago, a yellow banner started to appear in Fiddler reporting that my proxy settings had changed and that if I clicked the yellow banner, I could re-enable Fiddler traffic capture.
Upon clicking, the banner and the error message wouldn't go, and Fiddler had stopped capturing all traffic.
I searched the Web and found how to change the proxy settings back to 127.0.0.1 and port 8888.
However, when I do that, something keeps setting the port number back to 63758.
The version of Fiddler I am using is v2.4.9.9 on a Windows 7 Home Premium PC.
Please see picture attached. What should I do?
This probably belongs on Superuser rather than StackOverflow.
You don't need to "search the web" to change your proxy settings, just click the big yellow bar.
You'll need to find what is changing your proxy settings. My guess is that you're infected with Adware like BrowserSafeguard or GeniusBox. You can either use netstat -a -o to find the process listening on the port in question, or you can use SysInternals' Process Monitor to watch the Proxy Server registry key and see who is changing it.

Accessing Web Services from iPhone on PC through network

I asked a very similar question not too long ago and got some great responses. I've made it pretty far but still can't quite get things to talk. What I have is a PC running IIS and a web service inside of that. I'm trying to get the iPhone simulator on my Mac to be able to see this web service. I can ping my PCs local IP address from the Mac just fine, it's clearly alive and on the network. However, no matter what URL I enter into Safari the web service will not appear.
Any suggestions?
Thank you very much in advance.
Is this a web service or web application?
One fair possibility is that your Windows firewall could be blocking access to port 80. If it is, open your Windows firewall settings and add an exception for port 80 (Control Panel -> Windows Firewall -> Exceptions).
You might try using telnet on your Mac to test connecting to the web service/application.