Linux本地循环上的端口转发连接两个Android模拟器
我正在尝试在两个 android 模拟器之间进行通信,因此我正在尝试将端口 X 转发到 127.0.0.1 上的端口 Y,其中端口 X 也是我正在传输的端口,Y 是我正在接收的端口。这是否可能,如果可以,我如何转发本地端口?
I am trying to communicate between two android emulators for communication , thus I am trying to forward port X to port Y on 127.0.0.1 where port X is the port I am transmitting too and Y is the one I am receiving . Is this possible and if so how do I forward the local ports?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
socat 工具对此很有用:(
假设您使用的是 Linux)
The socat tool is useful for this:
(assuming you're in Linux)
谷歌搜索显示portfwd。虽然它很古老,但它似乎就是你所描述的。其他结果表明 iptables 也可以做你想做的事情,但我找不到简洁的指南。
Googling revealed portfwd. Although it is quite ancient, it seems to do what you describe. Other results suggest that iptables may be able to do what you want as well, but there were no succinct guides that I could find.
我想通过 AVD 控制台使用模拟器端口重定向会更容易 或
adb
命令< /a>.I would imagine it's easier to use emulator port redirections, either via the AVD console or the
adb
command.