Running selenium grid hub with https protocol - selenium-grid

I am running selenium grid in a secured private network. I want to receive request to hub in https protocol instead of http.
Simply,
Grid console: https://X.XX.XX.X:4444/grid/console
Grid : https://X.XX.XX.X:4444/wd/hub
I got to know about Ngnix server for receiving side and serve the request to hub and also reverse proxy for running hub in behind, but no idea how exactly to be done.
If anyone did in above or in other way. Please let me know.

Related

How to set Proxy in Karate Framework

I am trying to hit an API using IP port. But the Machine is behind a VPN. Even though my local is connected to the VPN, the HTTP connection is refused. Is there any provision to setup up VPN/Proxy in Karate Framework?
Yes. Please refer to the documentation: https://github.com/intuit/karate#managing-headers-ssl-timeouts-and-http-proxy

ERR_PROXY_CONNECTION_FAILED when using squid proxy for connection

I have a squid proxy container on my local Docker for Mac (datadog/squid image). Essentially I use this proxy so that app containers on my local docker and the browser pod (Selenium) on another host use the same network for testing (so that the remote browser can access the app host). But with my current setup, when I run my tests the browser starts up on the remote host and then after a bit fails the test. The message on the browser is ERR_PROXY_CONNECTION_FAILED right before it closes. So I assume that there is an issue with my squid proxy config. I use the default config and on the docker hub site it says
Please note that the stock configuration available with the container is set for local access, you may need to tweak it if your network scenario is different.
I'm not really sure how my network scenario is different. What should I be looking into for more information? Thanks!

Selenium grid hub behind nginx proxy

Can you run a Selenium server hub behind nginx, to proxy port 443/ssl (or 80 without) to localhost:4444 where Selenium server is bound? My remote nodes won't connect to Selenium server behind nginx, only if I specifically open port 4444 in the firewall and bypass nginx do remote nodes connect.
Not sure if nginx handles this. I imagine the problem is more that your network firewall blocks ports outside 443 and certain others, and expects all traffic to go via HTTPS.
Get your network administrators to allow a punch-through for port 443.
Host your CI platform behind the firewalled network
Look for an alternate way to access the application nodes -- some firewalled networks allow access to public nodes from a private network via a different IP/hostname from the normal ones
I don't think you could really run Selenium on, say, port 80, because the selenium server itself is not quite really a web service.
it's maybe a bit late for answering the question of #xref. However, I have just deployed my Selenium Grid behind Nginx.
In order to do so, I used Docker and Docker-Compose. I describe how to do it here
I hope it will be helpful for you.

Does Selenium Grid handsover the Node after connection?

As shown in this diag:
All the connections from the Selenium Tests(client) should go directly to Selenium HUB, then it will forward the request to an appropriate Node, and return the response.
But what i am observing, that after finding an appropriate Node, the client is trying to communicate directly to the Node.
But in case, the nodes are in a private network and are accesible only by the Selenium HUB and NOT ACCESSIBLE by the Selenium Tests(client) then the subsequent calls fails.
Any idea on how to force all the subsequent calls through the Selenium HUB only?
EDIT
The problem might be something different. My hub is running on 192.168.0.100(with another ip as 10.0.0.2).
So when i am connecting to 192.168.0.100 from my .Net RemoteWebDriverClient, after connecting to the appropriate node, it is using the another ip of the client(10.0.0.2) which is not accessible from my system.
The answer is NO, it doesn't. The Grid remain active throughout the connection.
The ip 10.0.0.2 was of the same selenium HUB machine only. The .net & java implementations of selenium RemoteWebDriver clients were switching to the location header parameter after the initial handshake. This is may be due to the .Net and Java HTTPClient implementations.

Unable to make web socket connection in Selenium opened googleChrome browser

Below is the test page to check the web socket connection, I am opening below page in selenium with (*googlechrome), i am unable to connect to the web sockets.
http://websocket.org/echo.html
However in normal googlechrome browser we are able to connect to the web socket.
What is the difference? appreciate your quick help..
~Ashok
Have you try to connect the web socket with other browser? I had the similar problem before but I was using Firefox, it turned out that the proxy setting wasn't get pass on to the firefox profile which selenium use.