Remotely viewing web pages served by pow.cx

前端 未结 3 1818
再見小時候
再見小時候 2020-12-28 20:57

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 somet

3条回答
  •  死守一世寂寞
    2020-12-28 21:14

    There are basically two options:

    • Don't use pow: run your applications on localhost as usual and access them as usual
    • Edit the hosts file (or local DNS) to point your server machine ip

    Example accessing from a virtual windows machine: Suppose you are running two rails applications in pow: store.dev and auth.dev, and you want to access them from a windows xp virtual machine to test them with IE, you only need to edit your hosts file to add the lines:

    C:\WINDOWS\system32\drivers\etc\hosts

    # Allow to access applications in pow. 
    # The ip address points to the host machine localhost, that usually is the default gateway
    10.0.2.2      store.dev
    10.0.2.2      auth.dev
    

    And then open the IE browser to access your applications in http://store.dev and http://auth.dev respectivelly.

提交回复
热议问题