I'm having a weird issue with the ipad and socket.io. I can connect without issues on a computer with a host entry or an IP address. I'm doing a simple connect as seen below:
var socketUri = 'http://rpi-scale-2.com';
socket = io.connect(socketUri);
The socketUri is a locally qualified domain. This connection happens and is successful on the desktop and windows tablets. It however isn't successful on an iPad regardless of browser. If we change the socketUri to an IP Address the iPad works great.
Can anyone give me any tips what might be causing the issues on the iPad?
Related
I have implemented a web service on my mac and I am able to access its functionalities through the url "http://localhost:8080/ServiceApp-war/resources/".
As I got satisfying results that I could see in the iPhone simulator in Xcode, I decided to connect my iPhone and test on it. But for this to work I think I need to change the "localhost" in my URL to the IP address of my mac.
I tried to replace it with my public IP address and I got a "could not connect to the server" error on my console. I also tried to replace "localhost" with the IP address I found in System Preferences-->Network-->Wi-Fi and I could see that it was working on the simulator but still nothing when I connect my iPhone and run the application on it.
Please provide a solution for accessing my web service remotely.
Thank you.
Create hotspot from your mac, connect to it with your iPhone and try again.
<lame solution>
Try some service for temporary domain, it will make your computer accessible from anywhere.
How do you "connect" your iPhone? USB connection does not create a network. Well, it does create if you turn on Personal Hotspot on your iPhone (maybe in some other cases, dunno). But the most simple way is to connect Mac and iPhone to the same WiFi network.
Once connected, you can use any of "ping" apps available on App Store. Just look for "ping" (some kind of "network reachability test" or so). You can check if your Mac is really reachable on the network.
If it's not reachable, check your network settings on both devices: do they belong to the same subnet, do they use the same gateway, etc.
If your Mac is reachable with ping, then you should deal with your web service. I setup the web server (which is already distributed within OS X): it already has all the settings to allow other devices to connect. But your web service may require some additional setup. It's two basic things: it should bind to your IP address (please check http://YOUR.IP:8080/ServiceApp-war/resources/ from your Mac!) and second, accept incoming connections from other agents, you should find it somewhere in its settings.
Ngrok was the perfect solution I was looking for.
https://ngrok.com
You could also try finch, which is similar to ngrok. It has a nice friendly GUI. https://meetfinch.com
I have my OS X development laptop hooked up to the net via an iPhone 5 connected with USB (Personal Hotspot). With a web server running locally for my development work, can I load pages from this server on my iPhone and then inspect them with Safari's Web Inspector? I have tried 127.0.0.1 and my connected IP public address but no success.
It is possible to do this - it just required a bit of investigation as to how the networking is arranged when using an iPhone via USB with Personal Hotspot. There are two steps:
Firstly, using USB, the USB port is setup as a network interface. The precise (and technical) details can be seen with ifconfig however what you need to know is what IP address is used for the USB interface.
Go to Network Preferences and select the iPhone USB on the left hand side. You will see a message like iPhone USB is currently active and has the IP address 172.20.10.2. Note that this is not the publicly available IP address, it is the network interface on the Mac. This is the ip address you need to type into the browser on your iPhone to see your local development server.
Secondly, you need to make sure that your local development server is serving the USB interface. This will obviously vary depending on your server but typically there will be a HOST parameter that directs the server to bind to that IP address. Again, use the IP address you found above to instruct the web server to serve pages on that IP.
I have a back end application on grails that runs into my PC and I want to access to its information throuw my mobile, I used a Rest web server for connection.
I tested the connection using an emulator on my PC, I acceeded to the application using the ip adress 10.0.2.2 and it worked
but I did not find how to do it using my mobile, I tried my IP local adresse cause my mobile is connected to the same wifi network as my pc, but it did not work.
Any ideas? what ip adresse can I use in this case and how to get it?
Thanks in advance.
I guess it is an issue network option, I tried in a public wifi network and it worked.
I found out that sharing option was deactivated in my PC so I activate them but still it did not work :(
My development environment is:
I have a Server application running on the windows and modified host.dat file to map to IP address with server url something like that
192.168.1.220 server.dev.com
192.168.1.221 server-rc.dev.com
to access these servers from Mac application I had to modify mac host file and it seems to be running fine till now.
Now I need to access the local server from iPhone, all the machines are in same wifi, is there any way to access the server application which is running over the window in my private network,
Googling the same problem, it says I need to setup the DNS name in the router, but I am not getting how to do the same.
Update:
From the iPhone simulator I am able to access server, problem coming only form the device.
Thanks for looking at it,
Making use of Fiddler, I could resolve this issue.
Detailed example here
So I have an ejabberd (XMPP) server setup on my MacBook. Connects fine with Simulator, only intermittently on the device. The two times it hasn't connected were at cafes that had sign-on gateways for their Wi-Fi. I know nothing when it comes to networks, but I'm guessing this is a Firewall thing?
I'm supposing I can't get around the firewall without an elaborate workaround.
I've found that turning off Wi-Fi on both devices and turning on tethering so that both devices are communicating via data works. However, I'd rather not do this as my data plan is limited and I'd like to be freely internet-connected while I work.
Is there a way to setup XCode to have the phone use the USB connection to access the server on the MacBook? Or maybe some other way I'm not imagining?
Bluetooth doesn't work.
I don't believe that the problem is with some kind of firewall on the network…
Try using the local IP address instead of the hostname, It will change from network to network. To get it, you can open the network utility
In this case it would be [xmppStream setHostName:#"172.16.1.2"];