-
Notifications
You must be signed in to change notification settings - Fork 272
Kubernetes DNS and Remote Webdriver #220
Description
Thank you for such an amazing tool you have built!
If I understand the functionality correctly, selenium-wire opens up a proxy socket on the addr
FQDN (and random port), and any requests from selenium are routed through this proxy. This allows the proxy to capture and process all the requests.
It took me a while to understand that the addr
FQDN is used for both - the creation of the proxy socket and from selenium to connect to the proxy.
I have set up a remote selenium grid on my kubernetes cluster, and I am trying to connect to it from another pod within my kubernetes cluster. The services for these pods are of type ClusterIP - meaning that the IP is randomly generated with each deployment. Kubernetes has intelligent DNS resolution where you can specify http://service-name:port, and it will resolve it to the IP address. So I should be able to open a port with service-name
in the addr
option, however when I try to do that, I get the following error:
seleniumwire.thirdparty.mitmproxy.exceptions.ServerException: Error starting mitmproxy server: gaierror(-5, 'No address associated with hostname')
I tried using 127.0.0.1
or 0.0.0.0
, and although I am able to create the proxy server, selenium is of course unable to connect to it and it fails with
Message: unknown error: net::ERR_PROXY_CONNECTION_FAILED
It would be beneficial if I could define, for example, an addr
to start the proxy server (where I could use 127.0.0.1) and another option to be able to reach that proxy server from selenium (where I can leverage the kubernetes DNS resolution).