0

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

PCoder
  • 2,165
  • 3
  • 23
  • 32
  • Do you mean that you want to access the app from a client which is connected to the server via wifi? – Kashyap Jul 25 '12 at 04:37

2 Answers2

0

You are going about it wrong.

If you invoke your server with the -h flag, 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 env tells 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.

Community
  • 1
  • 1
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
0

It turned out to be the proxy which was the culprit and giving the 403 error message.

And one can set the address, environment and port (including the wireless interface) for deployment using the options mentioned by the Tin Man. Thank you!

PCoder
  • 2,165
  • 3
  • 23
  • 32