Run a webserver on an iOS device
Asked Answered
L

2

11

I want to create an App that can share files between other iOS devices and potentially also Desktop computers.

So what I want to do is run a lightweight web server on my device that allows to download files from the device like so:

http://myphone.local:1234/folder/samplefile.txt

How can I provide such a server on a non-jailbroken device. I would prefer not to write a server like this from scratch :-).

Thanks a lot for your help

Lamar answered 7/12, 2011 at 14:55 Comment(4)
Would a web service be ideal for what you want?Geanine
@Carl I need the iOS device to act as a web server. So the iOS device is not the client in my case.Lamar
ahhh ok i read the question wrong sorry bout thatGeanine
What did you decide to use for the lightweight web server?Distort
B
18

Take a look at Cocoa HTTP Server

Boyar answered 7/12, 2011 at 14:57 Comment(3)
Thanks for pointing this out one out. I guess I've stumbled upon it some while back. It definitely looks promisingLamar
Sure I'll do this, bug I need to test it first.Lamar
Does Apple Approve this cocoaHTTPServer, if i make use it in my App? Couple of days back my App is rejected by Apple for making use of RoutingHTTPServer.Dia
B
3

According to the GitHub project:

CocoaHTTPServer is a small, lightweight, embeddable HTTP server for Mac OS X or iOS applications.

Sometimes developers need an embedded HTTP server in their app. Perhaps it's a server application with remote monitoring. Or perhaps it's a desktop application using HTTP for the communication backend. Or perhaps it's an iOS app providing over-the-air access to documents. Whatever your reason, CocoaHTTPServer can get the job done.

Boding answered 7/12, 2011 at 15:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.