Skip to content

Commit

Permalink
Use the proxy protocol when a webdriver proxy is configured (#7511)
Browse files Browse the repository at this point in the history
When the http protocol is different between the remote selenium
server and the webdriver proxy, an EPROTO error is encountered.

See #7509 for more information and a reproductible test case.
  • Loading branch information
theredfish authored and shs96c committed Sep 10, 2019
1 parent b288879 commit f25d117
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions javascript/node/selenium-webdriver/http/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ function sendRequest(options, onOk, onError, opt_data, opt_proxy, opt_retries) {
options.hostname = proxy.hostname;
options.port = proxy.port;

// Update the protocol to avoid EPROTO errors when the webdriver proxy
// uses a different protocol from the remote selenium server.
options.protocol = opt_proxy.protocol;

if (proxy.auth) {
options.headers['Proxy-Authorization'] =
'Basic ' + new Buffer(proxy.auth).toString('base64');
Expand Down

0 comments on commit f25d117

Please sign in to comment.