views:

202

answers:

1

Can someone give me simple code to help with creating an HTTP server for the iPhone. Something simple with much documentation would be appreciated. Anything you have please share.

+2  A: 

If you're unfamiliar with network programming your best bet is to first read Beej's Guide to Network Programming and then read the HTTP 1.1 spec before you look at source code (as you should have an understanding of the protocol before you start looking at implementations).

A simple Google search turned up cocoahttpserver and iSpit. Otherwise, you could download Apache and look at its source code, but that's not exactly a simple implementation.

Shaggy Frog
Great answer! +1
Jacob Relkin
I second that. A working minimal HTTP server with HEAD, GET, file size, and If-Modified-Since is an exercise of an hour or two.
Joshua