On Fri, May 15, 2015, at 10:00 AM, Soledad Penadés wrote:
> But connecting a phone to my laptop is not really practical sometime, so 
> I'd like to develop code using the simulator. However, I do not know how 
> to access the simulator. It doesn't have an IP address, and `lsof -i -n 
> -P -sTCP:LISTEN` doesn't show any port 80 accepting incoming 
> connections. I also tried accessing the server from the Browser app in 
> the simulator but it doesn't work either.

Linux and most operating systems only let super-user processes bind to
ports < 1024.  On your phone, b2g's main/parent process is running as
root so it is able to bind to port 80.  This is most likely your
problem.

I would suggest binding to port 8080 or something like that in this
case.  If you're not getting an error event when you call listen with
port 80, you probably need to notice that you're running in the b2g
simulator by sniffing the user agent or something equally hacky.

Andrew
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to