Bind Phantomjs to a Network Interface

喜你入骨 提交于 2020-01-17 03:44:30

问题


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.

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.


回答1:


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.



来源:https://stackoverflow.com/questions/29932658/bind-phantomjs-to-a-network-interface

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!