将Phantomjs绑定到网络接口 [英] Bind Phantomjs to a Network Interface

查看:111
本文介绍了将Phantomjs绑定到网络接口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有多个网络别名(eth0,ethh0:1,eth0:2),每个都有自己的私有ip和私有ip.当将远程Web驱动程序与phantomjs(ghostdriver)结合使用时,它始终会选择本地主机(请参见BUG https://github.com/ariya/phantomjs/issues/10269 ),用于客户端参数--webdriver = ip:port,因此我不能依靠phantomjs选择正确的接口.

I currently have multiple network alias (eth0, eht0:1, eth0:2), each having their own private ip which has its own public ip. When using remote web driver with phantomjs (ghostdriver), it always chooses the local host (See BUG https://github.com/ariya/phantomjs/issues/10269), for client argument --webdriver=ip:port, thus I cannot rely on phantomjs to pick the correct interface.

我目前的印象是我必须使用IPTABLES.连接到phantomjs(ghostdriver)驱动程序时,我想使用远程Web驱动程序将我的Java程序实例路由到其他公共ip.目前,我只能控制它侦听的端口.

I am currently under the impression that I will have to use IPTABLES. I want to route ever instance of my java program using remote web driver to a different public ip when connecting to the phantomjs (ghostdriver) driver. Currently I can only control the port that it listens on.

任何建议将不胜感激.

Any suggestions would be greatly appreciated.

推荐答案

到目前为止,解决此问题的最佳方法是使用反向代理.将代理选项与phantomjs一起使用以指定代理ip和端口,并配置反向代理以将流量重定向出去.

The best way so far to resolve this was to use a reverse proxy. Use the proxy option with phantomjs to specify the proxy ip and port, and configure a reverse proxy to redirect that traffic out.

这篇关于将Phantomjs绑定到网络接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆