问题描述
我期待找出我怎么能去转发从仿真器Android仿真器端口,可公开访问的端口。我已经做了端口转发到主机的本地回环接口上的端口,但我想要的端口是通过网络访问。这是试图运行从远程服务器建立在模拟器中的一些自动化测试的一部分。我无法从另一台机器presently访问端口,只能从本地主机连接接口。甚至试图在机器上进行连接,如果使用公共机器名,端口不是入店。
I am looking to find out how I could go about forwarding an Android emulator port from the emulator to a publicly accessible port. I have done port forwarding to a port on the host machine's local loopback interface but I want the port to be accessible across the network. This is part of trying to run some automated testing in the emulator from a remote build server. I cannot access the port from another machine presently and can only connect from the localhost interface. Even trying to connect on the machine itself, if the machines public name is used, the port is not accesible.
这可能是模拟器只是没有设计公开公共接口上的端口。在这种情况下,我会看看我是否能解决此问题使用某种O / S级端口转发从公共接口环回接口,如果这最终成为唯一的办法做到这一点得到的。
It might be that the emulator is just not designed to expose ports on a public interface. In that case I might see if I can get around the problem using some kind of O/S level port forwarding from the public interface to the loop back interface if this ends up being the only way to do it.
推荐答案
我已经成功地使用 stcppipe
才达到这一点。它只是转发TCP连接到任何的本地计算机接口,一个特定的IP地址(在您的情况这将是本地主机
)。
I've successfully used stcppipe
to achive that. It just forward TCP connections to any of local machine interfaces to a specific IP address (in your case it will be localhost
).
它可以从
与运行:
stcppipe.exe localhost port port
问候。
这篇关于Android模拟器,转发端口为公共接口,不是localhost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!