I am a newbie in developping for iOS, so please excuse me if I make
some obvious mistakes.
I'm trying to get the iPhoneHTTPServer working on the iPhone
Simulator, but I keep getting no response.
I'm working with Mac OSX Lion, XCode 4.1.
I have opened the project in XCode. It builds without a problem, I can
run it on the iPhone simulator. The log file shows the following (I
have added a call to get the ip address):
2011-11-21 17:38:14:735 iPhoneHTTPServer[925:b303]
HTTPServer[0x4e6d150]: init
2011-11-21 17:38:24:484 iPhoneHTTPServer[925:b303]
HTTPServer[0x4e6d150]: setPort:
2011-11-21 17:38:24:484 iPhoneHTTPServer[925:b303] Setting document
root: /Users/bart/Library/Application Support/iPhone Simulator/4.3.2/
Applications/D92B2124-B7FA-4000-83B9-54ACEBE16B32/iPhoneHTTPServer.app/
Web
2011-11-21 17:38:24:484 iPhoneHTTPServer[925:b303]
HTTPServer[0x4e6d150]: setDocumentRoot:
2011-11-21 17:38:24:484 iPhoneHTTPServer[925:b303]
HTTPServer[0x4e6d150]: start:
2011-11-21 17:38:24:485 iPhoneHTTPServer[925:b303] HTTPServer: Started
HTTP server on port 12345
2011-11-21 17:38:24:485 iPhoneHTTPServer[925:b303]
HTTPServer[0x4e6d150]: publishBonjour
2011-11-21 17:38:24:485 iPhoneHTTPServer[925:b303] Current IP Address:
192.168.6.129
Now, when I enter the url http://localhost:12345 into Safari, the
request times out.
When debugging the HTTPConnection.m file, it correctly enters (and
leaves) the "initialize" method, but when loading the page in Safari,
no other method is called.
Actually, I have the impression that the request never reaches the
http server.
I have tried to enter the device's IP address explicitly :
http://192.168.6.129:12345, but no cure, still no response. Nothing is
added to the application log.
The SimpleHTTPServer sample application when run from within XCode
does work fine on the Mac itself.
Any help would be much appreciated.
Thank you,
Bart
Unfortunately that does not work. Do you have a complete code example
running under ios5?
thanks for your help so far.
tim