简体   繁体   中英

Web server on wireless interface?

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 -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.

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM