I want to connect 3 iOS devices with each other.
For example, One iOS device will be like a server, and other 2 device will connect like client, to that server.
To make iOS Device, as server, i am using CocoaHTTPServer,
There is no any internet connection, should use only wi - fi
connection.
Any suggestion ?
I suggest you to use bonjour protocol which is used in ichat..this helps to deal with your problem..
These links may help you..
http://en.wikipedia.org/wiki/Bonjour_%28software%29
http://en.wikipedia.org/wiki/Apple_Filing_Protocol
ok, i solved this problem.
What i have:
(1) one wi-fi router
(2) two iOS devises.
Create local wi-fi network,
Connect 2 devises.
one of the devise will be server, by using this open source library CocoaHTTPServer.
example:
https://github.com/robbiehanson/CocoaHTTPServer/tree/master/Samples/iPhoneHTTPServer
in the iPhone(which is server) you should find the ip, that given by wi fi network, like 192.168.0.101
And uala, go to the iphone browser(which is not server)
and write url:192.168.0.101:9999 number
Related
There may be one or the other professional in the topic of TCP connections in iOS.
The user of my app can configure and connect a network device in the app. To connect the device, I want to show the user a list of available devices. However, I would only like to display devices with a specific port there.
I really hope that someone can help me.
Thanks!
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
Is there any way to communicate between two devices or application with Browser of other devices without having Server in the middle?
If I explain, actually I want to share data between iPhone application and Browser of Desktop, I tried HTTPServer, & played with WebSocket too, but in these case this server plays an important role in between. So If somehow I exchange data between two peers like IP Address, Port number, Then Is it possible to communicate between those two devices using Wi-fi channel without having Server in Middle?
The Way, Right now I have implemented.
The way, I am looking for.
I recently came across http://www.freedomjs.org/ which is suppose to provide p2p functionality in the browser.
Is it possible to create a chat application that works with Peer-To-Peer, so without a server connecting the devices?
I think this would be more trustworthy for users...
Yes it is possible, but you will still need some type of server or middleman that everyone connects to at first in order to find the people to chat and distribute their ips to each client, but from that point onward you can use tcp to connect the devices without a middleman.
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"];