I would like to know if it is possible to make ‘Sinatra’ listen on the wireless interface. With my little experimentation I have not been successful. When I try to run sinatra and access it through the wireless interface, I get
Forbidden
You were denied access because: Access denied by access control policy.
Normally, Sinatra starts listening at 0.0.0.0:4567, which as I understand includes all the interfaces (ethernet, loopback and wifi or more). Please clarify this if I am wrong.
Thank you
You are going about it wrong.
If you invoke your server with the
-hflag, Sinatra will spit out its help:Usage: server [options] -p port set the port (default is 4567) -o addr set the host (default is 0.0.0.0) -e env set the environment (default is development) -s server specify rack server/handler (default is thin) -x turn on the mutex lock (default is off)The
-e envtells Sinatra to use a specific environment.If I remember right, the problem is tied to the environment Sinatra, and Rack, think you’re running in, “development”, “testing” or “production”. “Sinatra configuring environments on the fly” has some important information for you, as does Sinatra’s “Configuring Settings” doc.