View localhost from Iphone using MacBook Pro - iphone

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!

Related

Cannot connect Charles Proxy to see traffic on any mobile

First of, I can see on traffic coming through when I browse on my desktop.
I have set the IP in network settings along with the port but when I connect I do not get the do you want to connect this phone message from Charles.
I have:
deleted all certificates and tried to go to chls.pro/ssl but get no internet message and the certificate doesn't download.
tried ios and android both with the same result.
tried to manually add it to the access devices in Charles.
The only difference is from two weeks ago when I last did this successfully is the VPN I am on (I open the Charles before connecting to the VPN, to rule that out).
Any suggestions? I am going crazy!
There are various issues that can cause this issue: I collect here and you can verify each step to solve it: https://docs.proxyman.io/troubleshooting/my-ios-devices-couldnt-connect-to-proxyman-via-proxy
I would like to summarize:
Check if your Firewall is blocking all incoming traffic -> Turn it OFF
Stop all VPN app from your iOS device
Make sure your iOS devices and your macOS are in the same network.
Disclaimer: I create the Proxyman app, which is a modern version of Charles-Proxy. Hopefully it helps you resolve the problem.

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.

Connect Device to Mac localhost Server? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 4 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
How do I allow any device, e.g., iPhone, to connect over a WLAN to my Mac's localhost server?
On my Mac, I'm running a "Hello World" HTTP Node.js server that serves a page, which Safari opens successfully, at http://localhost:1337. And, running ipconfig getifaddr en1 in Terminal outputs 192.168.1.9.
But, Safari, on both iPhone & Mac, displays "Safari can't connect to the server" when it tries to open http://192.168.1.9:1337.
I don't think this should involve port forwarding because I only want the HTTP server to be available privately, not publicly.
Related:
Accessing localhost from iPhone (in same network)
https://superuser.com/questions/308451/connect-to-localhost-from-another-computer
https://superuser.com/questions/400752/can-we-run-local-server-over-local-network-without-internet-access
https://serverfault.com/questions/254947/accessing-localhost-xampp-from-another-computer-over-lan-network-how-to
I had the same problem. I turned off my WI-FI on my Mac and then turned it on again, which solved the problem. Click Settings > Turn WI-FI Off.
I tested it by going to Safari on my iPhone and entering my host name or IP address. For example:
http://<name>.local or http://10.0.1.5
Have your server listen on 0.0.0.0 instead of localhost.
I was only able to access my iphone using http://name.local:1337. You have to add the ".local" You can find your computer name under System Preferences/sharing/"Computer Name".
Try enabling Internet Sharing:
Open System Preferences -> Sharing.
Check Internet Sharing to turn it on, it will prompt you to confirm your action, select ok.
If your iPhone is connected using USB, the iPhone USB is checked at the "sharing your connection" list on the right side.
After this, try accessing your local server using your macs ip on wifi.
My problem was the same, but the solution had to do with changing a firewall setting. It turned out that node was set to block incoming traffic. I knew something was up because I used to be able to get to my localhost server from my phone.
Go to System Preferences -> Security & Privacy -> Firewall -> Firewall Options, and then scroll down until you find node and make sure node's setting is set to Allow incoming connections.
After changing the setting, I could reach the localhost server (port 3000) running on my Mac by going to http://192.168.1.11:3000
I solve a similar problem.
connected Mac and iPhone to the same Wi-Fi
change the iPhone Wi-Fi setting, set http proxy to manual and change the Server to you Mac ip address and setting the Port. My Port is 80.
you can input http://<Mac ip>:<your customer server port> in iPhone's safari
MacOS Sierra users can find their auto-generated vanity URL by going to System Preferences > Sharing and checking beneath the Computer Name text input. To access it, enter this URL, plus your port number (e.g. your-name.local:8000), on your iPhone over the same Wi-Fi connection as your computer.
make sure you phone and mac machine both connected to the same wifi and you good to go your http://<machine-name>.local
Connect your iPhone to your Mac via USB.
Go to Network Utility (cmd+space and type "network utility")
Go to the "Info" tab
Click on the drop down menu that says "Wi-Fi" and select "iPhone USB" as shown here:
You'll find an IP address like "xxx.xxx.xx.xx" or similar. Open Safari browser on your iPhone and enter IP_address:port_number
Example: 169.254.72.86:3000
[NOTE: If the IP address field is blank, make sure your iPhone is connected via USB, quit Network Utility, open it again and check for the IP address.]
I suggest to use the name of the computer, e.g.http://mymac:1337/. Works for me perfect without any configuration required and I don't have to care about changing IP addresses due DHCP.
As posted I followed moeamaya's answer but needed to modify it just a bit to see my work in the Sites directory.
http://[name].local.~[username]/
[name] is as stated already (System Preferences/sharing/"Computer Name")
[username] is found at:
/etc/apache2/users/username.conf
hope this helps!
Tried everything on this page, but http://<name>.local:<PORT> only worked on my iPhone after I quit and restarted Safari...
Always use the IP that is shown in your Network settings. It changes when you change location and you use another wireless connection.
For example in my case now it is: 10.0.0.5
also, make sure the server is listening for ur mobile device! for example, by default jekyll only answers requests made by the host machine. this solved my problem:
Connect to a locally built Jekyll Server using mobile devices in the LAN

Why can't I access a web app running on my Mac via my iPhone?

I'm developing an iPhone app that has a network component. I'm developing the app in Java (Google App Engine actually), running on port 8080. And it works, when I test my app in the iPhone simulator.
But now I am trying to test on the device, and I can't hit my Jetty instance. I can certainly access my Mac via the iPhone because I'm able to hit http://10.0.1.7/~brianpapa/ and view my Home Folder when Web Sharing is turned on. But when I try to hit http://10.0.1.7:8080/, it says it can't connect to the server.
Interestingly, if I try to hit http://10.0.1.7:8080/ from my mac, it doesn't work either - I have to use localhost as the hostname instead, then it's fine. Has anybody ever encountered this before, and know how to fix it?
You need to bind the server to your external ip address. See the docs:
--address=...
The host address to use for the server. You may need to set this to be able to access the development server from another computer on your network. An address of 0.0.0.0 allows both localhost access and hostname access. Default is localhost.

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.