本文介绍了远程查看 pow.cx 提供的网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 WEBrick,您可以通过导航到 your.ip.address.here:port 导航到您从另一台设备/虚拟机提供的应用程序

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

是否可以用 pow.cx 做类似的事情?

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

推荐答案

具体来说,不是,因为 Pow 使用请求的 Host 标头来确定您需要访问哪个应用程序.要使其远程工作,您必须让远程机器将所需的域名映射到您的 IP 地址 - 使用本地 DNS 服务器或通过编辑 HOSTS 文件.两者都有可能,但很烦人.

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.

在这种情况下,最简单的方法是启动您提到的独立 Rails 服务器(根据版本使用 ./script/serverrails s),然后就可以像以前一样寻址http://[ip address]:3000.

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.

换句话说,Pow 之所以起作用,是因为它拦截了您的本地域解析,而不受远程机器影响(或可用于)远程机器.

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

这篇关于远程查看 pow.cx 提供的网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 13:36
查看更多