Search code examples
ruby-on-railsrack-pow

Remotely viewing web pages served by pow.cx


Using WEBrick you could navigate to an app you were serving from another device/virtual machine by navigating to your.ip.address.here:port

Is it possible to do something similar with pow.cx?


Solution

  • Specifically, no, because Pow uses the Host header of the request to determine which app you need to access. To get that working remotely, you would have to have the remote machine map the required domain name to your IP address - either with a local DNS server or by editing the HOSTS file. Both of which are possible but annoying.

    The simplest thing to do in that case is to start up a standalone Rails server as you mentioned (using ./script/server or rails s depending on the version), and then you can address http://[ip address]:3000 as before.

    In other words, Pow works because it intercepts your local domain resolution, something that isn't affected by (or available to) remote machines.