Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web server for Objective-C

How can I create a webserver from my Obj-C app, and post custom HTML to it?

Thanks!

like image 247
objectiveccoder001 Avatar asked May 27 '11 16:05

objectiveccoder001


3 Answers

Check:
SimpleHTTPServer
CocoaHTTPServer

like image 121
Anne Avatar answered Nov 14 '22 18:11

Anne


To embed a lightweight HTTP server in iOS or Mac apps, check out GCDWebServer which has a modern and clean architecture designed on top of Grand Central Dispatch.

like image 6
Pol Avatar answered Nov 14 '22 19:11

Pol


It would most likely be easier and far more secure to use something like FastCGI and then use an existing HTTP server such as Nginx to serve the HTML that your app passes along rather than trying to embed an HTTP server directly in your application. Plus Nginx is extremely fast and can handle huge server traffic without really breaking a sweat which not all other HTTP servers can say.

Plus using an embedded server means that your app and your HTTP server must run under the same UID which is bad from a security perspective as anyone compromising the HTTP server gains access to all your website files as well.

like image 1
Cromulent Avatar answered Nov 14 '22 19:11

Cromulent