I have a simple Behat feature that uses Mink for testing webapp which domain is, say http://myapp.localhost (I have a record like 127.0.0.1 myapp.localhost in my hosts file).
The problem is, when I run the feature, all what Mink driver gets when it browses to any URL in the app (e.g. with When I go to "/some/url" step) is an error page from proxy-server, saying that domain myapp.localhost cannot be resolved. Proxy server address is set by env. variable: export http_proxy=....
External websites work just fine (like an example with Wikipedia from Behat docs).
My browser can reach the app because there is a setting telling the browser not to use proxy when domain is *.localhost.
How to force Mink to ignore proxy?
Spent an hour today to pin down the problem.
The solution I use is not very elegant, but it’s the simplest way I can think of. I have some sort of build tool written in Bash, which has a following function to invoke Behat:
Basically, I just temporarily set
http_proxyto empty value, call behat, and then restorehttp_proxyinitial value.It is invoked from my script like that: