Hi i am developing iPad client server based application. It is required in application that when application starts it searches for specific server. If server found then connect with it and start consuming webservices on that server.
The point is user should not enter IP address of server. Application search servers and connect with specific server. Is there anyway to find server.
Apple has a technology called Bonjour which is designed for this kind of thing.
http://www.apple.com/support/bonjour/
http://my.safaribooksonline.com/book/programming/iphone/9780470918029/bonjour-programming/browsing_for_services
If you want a simpler solution, you could just use a DNS entry with a CNAME or A record pointing to the server.
Related
I want to build communication solution for my project. Thinking about not to develop everything from scratch, but to use XMPP servers.
My project consist of many "mini-servers" (based on raspberry pi) scattered around different locations. Every mini-server should be reachable for mobile applications on its own network, this network could be isolated from internet. Every "mini-server" has to be autonomous and be able to live without internet, autethicate its own mobile client and respond to their requests. So mini-servers could be on private offline networks, could be on known static or unknown dynamic IP addresses behind firewalls.
Some mini-server users want theirs mini-servers to be reachable from the internet. So there is one more, let's call it cloud. This cloud would be responsible for routing request from mobile clients from the internet to their mini-servers.
My idea was to use XMPP server on every mini-server, my application would log in to this server on localhost and create chatroom. Every mobile client would connect to xmpp server and chat with my application request-response. When mini-server owner wants to connect to the interet to be reachable from outside, I would just reconfigure xmpp server to connect to my cloud XMPP cluster (on known public domain) and mobile app to connect to this public cloud server if not on private network. Every mini-server will have its own users, managed by other app on it. Mini-server has also log, this could be written for example to another chatroom. Mini-servers or mobile users does not want to talk to each other. It is pure mobile user to mini-server request-response realtime communication.
Can cloud-XMPP servers route request to mini-server xmpp server?
Is this possible with XMPP? Is it good use? Some better ideas?
What you describe looks like XMPP server-to-server federation, with some local Raspberry PI XMPP domains and some other XMPP servers on the internet.
So, I think yes, what you would like to achieve is doable with XMPP server.
A server like ejabberd works very well on Raspberry Pi.
Today I'm hosting a Laravel v4 web application on a MacMini. Why a Mac? Because I created the application logic in Objective-C (leveraging my experience with iOS dev). Whether or not this was the right choice isn't the point of the question.
What I'm interested in knowing is how can I separate my web and application server. For instance, if I put my web server on Linode (or whatever) how do I go about communicating back and forth between the web server and the application server? Is there some sort of resource I can look to to understand how to do this?
Assumptions
Here's some assumptions I'm making:
I'm guessing Laravel and the Objetive-C Application are part of the same "system" and so I'm just gonna treat this as if you need a web server to send requests to a PHP application.
The Linode server will be a web server which sends request to the PHP application (Laravel)
Hosting PHP Applications
There are three moving parts:
The web server (Apache, Nginx)
The application gateway (PHP-FPM)
The application
The gateway and the code must live on the same computer/server. The web server can live on a separate computer/server.
This means you'll need your Macintosh to run PHP-FPM, which can then listen for remote connects and send them to the PHP application.
Macintosh
Install php-fpm on your mac. Make sure it can listen for remote network connections. This is usually done in the www.conf file in the listen directory, you can listen for connections on the remote network interface (whatever IP address the computer is assigned).
Linode
Install Nginx or Apache and have it proxy FastCGI requests off to your macintosh server at the macintosh's IP address (the one you set up to listen to addresses in the step above).
Firewalls
You may need to ensure the firewalls at both ends allow incoming/outgoing connects on the networks being used to communicate to eachother.
I have a netgear router and a PC that functions as the server. On the server I have a website that is hosted on a WAMP solution (windows, apache, mysql, php). Linux is an option, but Windows is first prize in this specific scenario.
What I need:
If someone connects to the wireless network, the splash page that is hosted on the server must be displayed.
All users must have bandwidth limits that are configurable for each user
I must be able to interact with the router via PHP code, in order to execute certain functions when certain users logon, etc.
So, my question is, how do people normally do this? Is there a way to configure this on the router (users connect to ROUTER), or is this something that can only be accomplished with a PROXY (users connect to proxy on server, server connects to internet via router).
Is this possible? Is there software available that does this? Is a proxy what I really need?
If your router supports it, you can install DD-WRT onto the router and use NoCatSplash to capture the connected user's first HTTP request and redirect it as needed.
i have a problem with local network connection. i'm writing an iphone application and i need to read/write files to a computer. Both devices connected on the same network.
if it's possible, i want to get connected computers ip list, select one of them and read/write files like pdf, doc, txt etc.. if it's not possible to do, i will write the computer ip which i want to connect. There is no problem, both of solution is OK.
But i dont know what do i do after get the computer's ip ?
i found this chat client/server on local, but i got it very complicated.
Anyone have any idea about this ?
You'll need to have a server running on the computer, which can show files and allow for files to be read and created.
Easiest is to run a webdav service on the computer, Apache provides the mod_dav module for this purpose.
The iPhone app then becomes the client. I'd suggest using neon for this purpose. It's a C library that provides listing, reading and writing files on a remote webdav server.
That's how I would do it.
1) Find the network address of the computer you want to connect to. For this you can make use of Bonjour. It's very easy to setup because Bonjour handles the resolving of address for you.
You just have to publish a service (e.g. _myprotocol._tcp) via the ´NSNetService` class which is available on iOS and OS X (Windows too)- in your case you would publish the service on your computer.
Then you search for the service with the NSNetServiceBrowser class.
When you found a service you can then resolve it. This actually gives you the network name of the other device.
2) Connect to the other device via a tcp socket. The CocoaAsyncSocket library is very good at this. This project also includes some examples. One example already provides a bonjour server and client implementation.
i found exactly what i want. The solution is here
I am working on an iphone app in which i want to access database from server through a VPN
Edit as i search. connection To server through is VPN is difficult and i was not found any solid information about this SO now i divide my Question in to two parts and part 1 is important to do as compare to other
Question 1
i have a SQL server DATABASE and a live ip of this server and i want to establish connection and access database through iphone . mean i iphone app store, select data or perform any DDL or DML methods from it self?
e.g
when user givs its info iPhone apps saves it on SQL SERVER DATABASE
Question 2
how can i do this all or which mean of communication is best through VPN how can i do and how can i hit or live IP?
You need a setup with a VPN-Gateway, which your iPhone is connecting to and some infrastructure behind the VPN-Gateway: at minimum the server the database is running on. The VPN connection can be setup in the iPhone Settings (you need the IP of your VPN-Gateway, Account, Password...), this has to be done manually and can't be controlled by the App. Once the VPN is setup and activated you can access the database as you would do it with any other App.
Edit: Question 2: I'm not sure if VPN is the right choice here. Is your server publicly available or is it inside an intranet? If it's publicly available a SSL/TLS connection would be the better choice instead of a VPN.