assaf / zombie

Insanely fast, full-stack, headless browser testing using node.js
http://zombie.js.org/
MIT License
5.65k stars 518 forks source link

Is there any way to bind to specific IP address on the machine? #1171

Open knife-s opened 6 years ago

knife-s commented 6 years ago

Hello I was looking for a way to bind the requests to a specific IP address but I didn't find anything.

Something equivalent to the "CURLOPT_INTERFACE" param, does zombie support something like that? Thank you in advance.

Cheers, knife

StefanoDeVuono commented 6 years ago

zombie has a reroute library which is loaded into the Browser object and can be used like so:

Browser.localhost('example.com', 3000)

However this just binds us to localhost. So, it, in and of itself doesn't fix your problem, but it does contain some methods that can get the job done (specifically the rerouteOptions function).

I'm working on factoring out the reroute library into a separate module and adding the ability to intercept node's DNS requests, if anyone is interested in helping.