This project has moved. For the latest updates, please go here.

Url for testing HttpServer with emulator

Nov 6, 2010 at 2:56 PM

What would the default Url be to get to an HttpServer hosted by the emulator?  The server code appears to start up properly (returns true).  Would it be http://localhost/???

Coordinator
Nov 6, 2010 at 3:11 PM

Hi James,

by default the HttpServer is using port 80 on localhost but in emulator this port is not working (this is NO bug in HttpServer). To get it working in emulator you should create the instance with the constructor port argument:

using (HttpServer http = new HttpServer(81, new MyHttpHandler()))
{
    http.Start();
    while (!stopThread)
        Thread.Sleep(1000);
}

Does this help?

Regards,
Michael


Nov 6, 2010 at 3:18 PM

That works perfectly - thanks!!