I'm looking for an easy way for users to download content from an iPhone to their computer. I've seen other apps that actually turn the iPhone into a server and give the user an IP address to navigate to on their computer. I've glanced at some Apple samples, but nothing looked too much like what I was going for.
So what's the easiest way to make a server that listens on TCP port 80 (even better, an HTTP server) and sends responses? Hopefully using Objective C classes, but I can make a wrapper if there isn't anything available.
use iCloud as a web server is impossible.
Want to run a simple web server off of an iPad or iPhone? If you have iSH linux shell running in iOS then you can easily start and run a simple web server directly from an iPhone or iPad.
iOS Server is a native app that offers all the features of Apple's OS X Server product for the iPad. Instead of being tied to Macintosh Hardware you can deploy iPads for your back-end infrastructure. You gain many benefits by using iPad: iPads are mobile.
Google Toolbox for Mac has a class called GTMHTTPServer.
Deusty Designs has a project called CocoaHTTPServer.
You can't use port 80 because it requires root access.
Cocoa provides lots of support for client-side networking but not a lot for server-side.
At the lowest level, you can use normal BSD sockets.
The next level up is CoreFoundation (plain C but using Cocoa-like types). Relevant CoreFoundation APIs are CFNetwork
, CFSocket
and CFStream
(CFStream
is a file-stream that can have its source through a network -- it is not a System V style network Stream).
In Objective-C, you can look at NSStream
which is the Objective-C equivalent of CFStream
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With