iOS devices as web server [closed] - iphone

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I saw there are several apps on App Store that allow other computers to make a http connection to the iPhone/iPad devices to transfer files. It seemed like a web service is running on the iOS device. Just curious how is it done /what class was used?
Thanks.

Just display the devices IP address, open a socket for listening in an app running on the iOS device, and implement the http protocol. There are several 3rd party libraries that can do most of the heavy lifting for you:
CocoaHTTPServer or iPhoneHTTPServer3, or SimpleWebSocketServer, or MultithreadedHTTPServer3

You can use GCDWebServer
It's a modern web server for iOS and MacOS based on grand central dispatch.

Like answered before the best choice is to use a 3rd party library for this. There exist mainly two libraries to get the job done: CocoaHTTPServer and MongooseDaemon.
Both of them have an Objective-C API but MongooseDaemon is just a wrapper around the Mongoose HTTP server written in plain c, whereas CocoaHTTPServer is completely written in Objective-C.
We decided to go with CocoaHTTPServer because of a few simple reasons:
Even the simplest property like setting the document directory for the HTTP server does not exist in MongooseDaemon. You have to change a #define in an included source file to be able to change it from the default one, which points to NSHomeDirectory().
As of now the MongooseDaemon library contains warnings about deprecated methods used within the Objective-C wrapper.
CocoaHTTPServer is aware of things like Bonjour or WebDav whereas Mongoose just delivers the basics.
CocoaHTTPServer comes with many examples that range from simple HTTP servers, passwd, SSL/TLS or WebDav HTTP server.
CocoaHTTPServer works with GCD to enable multithreading.

MongooseDaemon is also a good choice.
https://github.com/face/MongooseDaemon

Related

what is the best server to make chat app in android? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I want to develop a chat app for android users app will be native and I want to know which will be more easy for me using firebase or XMPP?
Firebase
Firebase is a real-time database that uses Websockets and MongoDB. You are given full control over the database schema and all the code that’s used to interact with the server is defined on the client side. Here are some benefits and drawbacks:
Performance Websockets and MongoDB allow high performance and a lot of concurrent connections
Flexibility You can make the data structures you need. If you wanted to send new message types like a survey message, you could. You could also support WebRTC and use Firebase for signalling.
Persistence You can automatically back up messages on the server so if a user loses their device, they could just synch with server and get their messages back.
Frameworks There are existing frameworks that already provide messaging on Firebase. The Chat SDK has a framework for iOS and Android which are available for free on Github.
Fat client All the messaging logic is defined in client code which means to add a new platform, you have to re-write all the code.
Not Specialised Firebase doesn’t define any protocols so you would have to invent this yourself. You would have to decide what information to include on a message, and how to structure the database
XMPP
XMPP is a server that is specifically designed for messaging. As far as one exists, it is the industry standard messaging protocol. It’s used by big companies to power messaging for millions of users. It’s used in Skype, Facebook messenger, WhatsApp and Google Hangouts.
Performance XMPP servers can be clustered scaling to tens of millions of users
Open Source There are a number of excellent open source XMPP servers - ejabberd, OpenFire, Prosody
Defined Protocol XMPP is a well defined protocol. This means that in theory, any XMPP app can function with any XMPP server
Thin Client The XMPP server provides all the business logic and the client just sends and interprets a stream of XML messages. This makes it easier to deploy on multiple platforms.
Hard to setup XMPP servers can be difficult to setup and maintain
Complex development Developing a client for an XMPP server can be much more difficult and time consuming that using Firebase because the protocol seems dense and archaic at times
Bugs Unfortunately the protocol isn’t always followed correctly which can lead to bugs

How can I start to build voice chat application iPhone? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 months ago.
Improve this question
I want to build voice chat application for iphone.
After surfing and searching i conclude that for making of voice chat app i have to use VOIP/SIP protocol.
So my question is that,
It's necessary to use VOIP/SIP protocol for voice chat? If YES then how can i use VOIP/SIP in my app? Is there any tutorial or blog which explain step by step implementation?
And if it's not necessary to use VOIP/SIP then what is the alternate way for developing Chat application ?
Thanks in advance.
It is not necessary to use SIP. SIP is one of the umbrella standards that enable you to create multimedia sessions of any kind, however with SIP you will also have to implement a number of other things - Offer/Answer model using SDP (Session Description Protocol), use a RTP (Real time protocol) for actual voice transmission, likely MSRP (Message Session Relay Protocol) for session oriented messaging and then possibly look at Presence and whole slew of standards under SIP/SIMPLE.
Now you don't have to do it all and it all depends on what you want to do and how many and what types of other clients and 3rd party servers you want to interface with.
Have a look at existing free SIP software and see what makes sense for you.
Alternatively have a look at XMPP which is more suited for chat and presence kind of requirements. Specifically look at Jabber and see if that makes sense.
You do not need to use SIP. For example, ConnectyCube video solution is based on XMPP for chat and signaling to establish the connection before the call and WebRTC standard for video calls. You can check code samples to see how they implemented it on iOS.
To try the solution you can register a free account. If it suits you, you can use their SDK to speed up the development.
The benefit of using a ready backend with SDK is also that you do not need to worry about setting up a STUN/TURN server for routing video calls. They have a shared one you can use.

Direct VoIP call from one iOS device to another

I'am going to develop peer-to-peer VoIP iOS application. And want do it without any SIP proxy, SIP providers and other servers. Just VoIP calls frpm iOSdevice-to-iOSdevice. Both iOS device could be somewhere in Internet. Is it real in VoIP (with PJSIP for example and general with SIP)?
Could you please point me to main keys that I need for development.
I have already read these topics. Is it real solve problems with addressing in my configuration. PJSIP could help with correcting addressing?
Look at Apples Multipeer Connectivity framework. I have built an app that does exactly what you want. If you look to my profile and the questions I have asked you will get some good guidance. Though I recommend you do it with a backend since MultiPeer wasn't the best solution, atleast when it comes to supporting multiple peers and to be able to call another device that has the app in the background.
See Frank Shearar's Answer Here
In short, it looks like this would be a very difficult task.
Another option would be to use the Twilio SDK for iPhone (Obj-C). This would work well for what you're trying to do and would be a whole lot easier. Link

VOIP using XMPP Framework in iPhone [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am able to implement Facebook and Gmail chat with the help of XMPP Framework in my iPhone app. Wanted to know if its possible to implement VOIP(SIP) in a similar manner using XMPP.
You can use jingle framework.This is what jingle wiki says:
"Jingle is an extension to the Extensible Messaging and Presence Protocol (XMPP) which adds peer-to-peer (P2P) session control (signaling) for multimedia interactions such as in Voice over IP (VoIP) or videoconferencing communications. It was designed by Google and the XMPP Standards Foundation. The multimedia streams are delivered using the Real-time Transport Protocol (RTP). If needed, NAT traversal is assisted using Interactive Connectivity Establishment (ICE)."
The libjingle library, used by Google Talk to implement Jingle, has been released to the public under a BSD license. It implements both the current standard protocol and the older, pre-standard version
Also there is a framework in Google project repository.
http://code.google.com/p/libjingle/
Also, one more link related to this:
iOS: Open Source VoIP/SIP Objective-C Code
May be this will give you an idea.
Its possible to implement VOIP using XMPP. For ios many are providind SDK's which you can easily implement in your code. Among that one of the best is QuickBlox, which is very useful and easy to implement. Its providing P2P video chat, text chat , group chat and file transfer facilities.
But now WebRTC is gaining much popularity for VOIP purposes.WebRTC (Web Real-Time Communication) is an API definition being drafted by the World Wide Web Consortium (W3C) to enable browser to browser applications for voice calling, video chat and P2P file sharing without plugins.
Open Tok is a rather useful product which can be used for VOIP calling in ios devices. They are also providing a basic IOS sdk for easy implementation.
checkout these two products:
1- monal: https://itunes.apple.com/us/app/monal/id317711500?mt=8
2- talkonaut: https://itunes.apple.com/us/app/talkonaut/id375113323?mt=8
they both claim to support jingle

How can I build/install/run a server program to communicate with the iPhone?

I'd like to play with the idea of creating a server program that communicates with an iPhone app over socket connections. I've found several guides within Apple's documentation for client side programming (with CFNetwork, NSStream, etc) but I don't know where to begin on programming the server application, or even what language to use, or for that matter, how to deploy and run a server application on my current web hosting package through Go Daddy. A simple instant messenger style application example should get me started, but any advice is appreciated.
if you want to create socket connection is better to use CFNetwork , it has more flexibility for you I already used NSURLConnection but CFNetwork has better performance. this is my steps and how I developed my app :
configuration of server
selection C++ for my server side (service)
start to develop a client-side app for iphone to connect to server using NS classes
but I had some problems in sending and receiving message to and form server . so I changed it to CF classes it works better and faster now.
The easiest way to handle server-to-device communications is to use APNS (Apple Push Notification Services).
Communication in the other direction (device-to-server) can be handled simply with NSUrlConnection.
If you want to write your own socket code for this, well - good luck with that.
Do you want your client application to be able to run on more than one OS? If so, you might want to stay clear of anything Apple specific. Although, if you strictly want to run on iOS, using MusiGenesis' suggestion could save you a ton of time.
I have found that Python and Perl are both pretty great for socket programming. I know that Python has several libraries built in for handling HTTP requests etc. If you want to run your server as a daemon, I found this code very helpful:
http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
Here is a general python sockets guide:
http://docs.python.org/howto/sockets.html
Good luck.