Fail to connect to proxy

So, I have this problem when I open the preview the application on my iPhone 5, I have to connect to a proxy server for some reason. I press “connect” and then after a while, it says that it can not connect. I have tried every IP-adress possible.

Please help me.

Thanks in advance.

This is not what you normally think of as a proxy server in a network setup, it is just the part of Fuse that accepts incomming connections from your various devices, and connects them to the project you are previewing on that device. It is running on the machine you are running Fuse on.

Does local preview work? Have you tried previewing on Android? What is the output of running the following commands in a terminal? hostname, ping -c 1 $(hostname)?

usage: ping [-AaDdfnoQqRrv] [-b boundif] [-c count] [-G sweepmaxsize] [-g sweepminsize] [-h sweepincrsize] [-i wait] [−k trafficclass] [-l preload] [-M mask | time] [-m ttl] [-p pattern] [-S src_addr] [-s packetsize] [-t timeout][-W waittime] [-z tos] host ping [-AaDdfLnoQqRrv] [-b boundif] [-c count] [-I iface] [-i wait] [−k trafficclass] [-l preload] [-M mask | time] [-m ttl] [-p pattern] [-S src_addr] [-s packetsize] [-T ttl] [-t timeout] [-W waittime] [-z tos] mcast-group

        This what I got after typing the the command "ping -c 1 $(hostname)"

That is strange. Please try instead to type hostname, then copy the output of that command manually and use as the argument to ping. Here’s an example from my machine:

knatten / $ hostname
Anderss-MacBook-Pro.local
knatten / $ ping -c 1 Anderss-MacBook-Pro.local

Also, have you tried local preview? And where are you starting preview from, the dashboard, the Sublime Text plugin, or the terminal?

What was the result of running the hostname command?

Either you replace that in your ping, or you write:

ping -c 1 hostname

I think I did it correctly as you said and this is what I got after copying my hostname and typing “ping -c 1”.

ping: cannot resolve Arntzens-MacBook-Pro.local: Unknown host

Ok, it seems you have a general network issue with your machine, where you are not able to resolve your own host name. One way forward would be to try to correct this.

However, modern versions of Fuse (0.9.1 or later) has a fallback mechanism that should be able to work around issues like this. Which version are you running? (check fuse --version, or the Fuse menu bar icon.) If you haven’t already, it’s a good idea to upgrade to the latest version, currently 0.9.4.

Please let me know if I should converse here or create a new topic or bug? I am also experiencing the same symptoms with iPhone7 Plus connected via USB and would appreciate insight on what I may be doing wrong. Thanks in advance.

Error Messages:

1. "Failed to Connect"
2. Please check that this device is connected to the same network as your computer. 
3. Failed to connect to proxy:
127.0.0.1:12124: Connection Refused
127.0.0.4:12124: Operation timed out

=> I have verified that both my iPhone 7 and MBP are successfully connected to the same WIFI network and that my USB cable is good. In my case, I launch from the command line by running ‘fuse preview -tios’ and get a successful XCode build. I can see the app on my iPhone which suggests it was installed but just fails to handshake with my MBP to launch.

I am using Fuse on my Personal Macbook Pro that has the Amazon image for security purposes. My platform details are as follows.

Fuse version: use version 0.28.0 (build 8142)
MBP 2013 edition, running OSX El Capitan 10.11.6
Preview Device: iPhone7 Plus running iOS 10.1

When running the command line diagnostic per the earlier dialog in this thread, I get the following output:

calvin@~/Documents/Safezone/Projects/fuse/examples/circle-menu$ hostname
28cfe9143aa7.ant.amazon.com
calvin@~/Documents/Safezone/Projects/fuse/examples/circle-menu$ ping -c 1 $(hostname)
ping: cannot resolve 28cfe9143aa7.ant.amazon.com: Unknown host
calvin@~/Documents/Safezone/Projects/fuse/examples/circle-menu$ 

For Fuse preview to work, the preview app has to be able to connect to the machine that runs Fuse. From your post above, it looks like Fuse only finds the local loopback address, and not a public IP. I don’t know how AMI works or how you’ve set it up, but you need to make sure it has a publicly reachable IP address, and allows your device to connect to it on port 12124.

Hi Anders.
I am not following because when I use my browser, several resources tell me that my public IP(v4) is: 67.168.134.118. Furthermore I can ping that address and get this output.

calvin@~/Documents/Safezone/Projects$ ping 67.168.134.118
PING 67.168.134.118 (67.168.134.118): 56 data bytes
64 bytes from 67.168.134.118: icmp_seq=0 ttl=255 time=1.426 ms
64 bytes from 67.168.134.118: icmp_seq=1 ttl=255 time=3.430 ms
64 bytes from 67.168.134.118: icmp_seq=2 ttl=255 time=3.605 ms
64 bytes from 67.168.134.118: icmp_seq=3 ttl=255 time=0.933 ms
64 bytes from 67.168.134.118: icmp_seq=4 ttl=255 time=3.609 ms

As an aside, I get this same error on both my iPhone7 as well as my iPhone 6 regardless if I am workign from my home network, office, or any public cafes. What else can I do to find the root cause and resolution?

That is the public IP of the network you are currently on, not the public IP of your AMI image.

You need to make sure your AMI image has an IP address that can be reached from your private network. I don’t know how AMI works, you’ll have to check their documentation for this.

Let me try to clarify the confusion that I may have cuased. The Fuse project I am trying to preview is running on my personal laptop, not an AMI running on AWS. The laptop has an Amazon network login associated; however, I am not logged into the network. All of my Fuse work occurs while I am logged into my local laptop account. As for the public IP, I believe that IP is associated to my modem and assigned by my Internet Service Provider. My laptop has an internal IP that is assigned by my router that does the NAT translation for internal network.

Through troubleshooting, I have found that running a build, via $fuse build --target=ios --run does successfully install the app and runs it without the error I get when I do $fuse preview -tios. Doing a build, is a decent workaround but I believe I lose the convenice of live preview that is very helpful during development. Any thoughts on what else I can try to get live preview working on my device?

Thanks for the clarification, I was under the impression that you was running an AMI locally.

Can you please do the following:

Are you running any kind of software firewall on your machine?

I appreciate the help! Thank you. I have attached the output and uploaded the gzipped file.

calvin@~/.fuse$ ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
	options=3<RXCSUM,TXCSUM>
	inet6 ::1 prefixlen 128 
	inet 127.0.0.1 netmask 0xff000000 
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
	nd6 options=1<PERFORMNUD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	ether 28:cf:e9:14:3a:a7 
	inet 10.0.1.9 netmask 0xffffff00 broadcast 10.0.1.255
	media: autoselect
	status: active
en3: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
	options=60<TSO4,TSO6>
	ether 32:00:10:13:3d:20 
	media: autoselect <full-duplex>
	status: inactive
en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
	options=60<TSO4,TSO6>
	ether 32:00:10:13:3d:21 
	media: autoselect <full-duplex>
	status: inactive
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
	ether 0a:cf:e9:14:3a:a7 
	media: autoselect
	status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
	ether 76:6e:59:50:54:8d 
	inet6 fe80::746e:59ff:fe50:548d%awdl0 prefixlen 64 scopeid 0x8 
	nd6 options=1<PERFORMNUD>
	media: autoselect
	status: active
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=63<RXCSUM,TXCSUM,TSO4,TSO6>
	ether 2a:cf:e9:41:04:00 
	Configuration:
		id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
		maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
		root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
		ipfilter disabled flags 0x2
	member: en3 flags=3<LEARNING,DISCOVER>
	        ifmaxaddr 0 port 5 priority 0 path cost 0
	member: en2 flags=3<LEARNING,DISCOVER>
	        ifmaxaddr 0 port 6 priority 0 path cost 0
	media: <unknown type>
	status: inactive
calvin@~/.fuse$ 

Thanks! Is local preview working?

What happens if you do telnet 10.0.1.9 12124 and press enter? Does it say Connected to 10.0.1.9, and then Connection closed by foreign host., or does it go straight to Connection refused?

Do you have any other machine on your local network that you could use to see if you are able to connect to your machine over the network?

By the way, when your device fails to connect, can you double check whether your ip 10.0.1.9 is mentioned on that screen, or if it just lists 127.0.0.1? For instance, here is how it looks on my computer if I have a network issue:

I get this series of error messages, followed by the same buttons you have.

1. "Failed to Connect"
2. Please check that this device is connected to the same network as your computer. 
3. Failed to connect to proxy:
127.0.0.1:12124: Connection Refused
127.0.0.4:12124: Operation timed out

I’ve tried pressing on the Change IP and entered my public IP but that failed in the same way.

Here is the screenshot of the error on my iPhone7.

Is local preview working?

What happens if you do telnet 10.0.1.9 12124 and press enter? Does it say Connected to 10.0.1.9, and then Connection closed by foreign host., or does it go straight to Connection refused?

Do you have any other machine on your local network that you could use to see if you are able to connect to your machine over the network?

The (Macbook Pro) laptop that I do fuse development can resolve that hostname but fails to do so if I include port :12124. Please see the difference in the following output. I also get the same result with my desktop (an iMAC on the same network).

calvin@~/Documents/Safezone/Projects$ telnet 10.0.1.9:12124
10.0.1.9:12124: nodename nor servname provided, or not known
calvin@~/Documents/Safezone/Projects$ ping 10.0.1.9:12124
ping: cannot resolve 10.0.1.9:12124: Unknown host
calvin@~/Documents/Safezone/Projects$ 
alvin@~/Documents/Safezone/Projects$ ping 10.0.1.9
PING 10.0.1.9 (10.0.1.9): 56 data bytes
64 bytes from 10.0.1.9: icmp_seq=0 ttl=128 time=0.090 ms
64 bytes from 10.0.1.9: icmp_seq=1 ttl=128 time=0.140 ms
64 bytes from 10.0.1.9: icmp_seq=2 ttl=128 time=0.127 ms
64 bytes from 10.0.1.9: icmp_seq=3 ttl=128 time=0.137 ms
64 bytes from 10.0.1.9: icmp_seq=4 ttl=128 time=0.152 ms
64 bytes from 10.0.1.9: icmp_seq=5 ttl=128 time=0.152 ms
^C
--- 10.0.1.9 ping statistics ---
6 packets transmitted, 6 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.090/0.133/0.152/0.021 ms
calvin@~/Documents/Safezone/Projects$ telnet 10.0.1.9
Trying 10.0.1.9...
telnet: connect to address 10.0.1.9: Connection refused
telnet: Unable to connect to remote host

It appears to be port related and I am not familiar with port 12124 and would have expected telnet to run on port 23. Does the Fuse installation or Preview automatically opens up port 12124, and if so, how would we know if it succeeded or failed to do so? FYI, this is what I get when I run a netstat.

calvin@~/Documents/Safezone/Projects$ netstat -n
Active Internet connections
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)    
tcp4       0      0  127.0.0.1.9218         127.0.0.1.55805        CLOSE_WAIT 
tcp4       0      0  127.0.0.1.55805        127.0.0.1.9218         FIN_WAIT_2 
tcp4       0      0  10.0.1.9.55742         52.5.33.8.443          ESTABLISHED
tcp4       0      0  10.0.1.9.55344         54.83.120.182.443      ESTABLISHED
tcp4       0      0  10.0.1.9.55343         54.165.24.88.443       ESTABLISHED
tcp4       0      0  10.0.1.9.55328         199.59.148.11.443      ESTABLISHED
tcp4       0      0  10.0.1.9.55326         172.217.3.206.443      ESTABLISHED
tcp4       0      0  127.0.0.1.9217         127.0.0.1.55300        CLOSE_WAIT 
tcp4       0      0  10.0.1.9.55294         17.249.44.22.5223      ESTABLISHED
tcp4       0      0  10.0.1.9.55285         17.188.166.21.5223     ESTABLISHED
tcp4       0      0  10.0.1.9.55283         74.125.28.188.5228     ESTABLISHED
tcp4       0      0  10.0.1.9.55278         216.58.193.69.443      ESTABLISHED
tcp4       0      0  10.0.1.9.55275         10.0.1.6.445           ESTABLISHED
tcp4       0      0  10.0.1.9.54189         40.76.93.149.443       CLOSE_WAIT 
tcp4       0      0  127.0.0.1.12122        127.0.0.1.54188        ESTABLISHED
tcp4       0      0  127.0.0.1.54188        127.0.0.1.12122        ESTABLISHED
tcp4       0      0  127.0.0.1.52875        127.0.0.1.52876        ESTABLISHED
tcp4       0      0  127.0.0.1.52876        127.0.0.1.52875        ESTABLISHED
tcp4       0      0  127.0.0.1.52869        127.0.0.1.52870        ESTABLISHED
tcp4       0      0  127.0.0.1.52870        127.0.0.1.52869        ESTABLISHED
tcp4       0      0  127.0.0.1.12122        127.0.0.1.49835        ESTABLISHED
tcp4       0      0  127.0.0.1.49835        127.0.0.1.12122        ESTABLISHED
tcp4       0      0  192.168.1.76.49363     40.76.93.149.443       CLOSE_WAIT 
tcp4      37      0  192.168.1.76.49357     40.76.93.149.443       CLOSE_WAIT 
tcp4       0      0  127.0.0.1.12122        127.0.0.1.49351        ESTABLISHED
tcp4       0      0  127.0.0.1.12122        127.0.0.1.49350        ESTABLISHED
tcp4       0      0  127.0.0.1.49351        127.0.0.1.12122        ESTABLISHED
tcp4       0      0  127.0.0.1.49350        127.0.0.1.12122        ESTABLISHED
tcp4       0      0  127.0.0.1.49153        127.0.0.1.1022         ESTABLISHED
tcp4       0      0  127.0.0.1.1022         127.0.0.1.49153        ESTABLISHED
udp4       0      0  10.0.1.9.51187         74.125.28.189.443                 
udp4       0      0  *.63065                *.*                               
udp6       0      0  *.49659                *.*                               
udp4       0      0  *.49659                *.*                               
udp6       0      0  *.65199                *.*