File tree 2 files changed +29
-0
lines changed
javascript/node/selenium-webdriver
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 7
7
* Added support for Safari 10 safaridriver. safaridriver may be disabled
8
8
via tha API, ` safari.Options#useLegacyDriver ` , to use the safari
9
9
extension driver.
10
+ * Updated the ` lib/proxy ` module to support configuring a SOCKS proxy.
10
11
11
12
### API Changes
12
13
Original file line number Diff line number Diff line change @@ -76,6 +76,34 @@ exports.manual = function(options) {
76
76
} ;
77
77
78
78
79
+ /**
80
+ * Creates a proxy configuration for a socks proxy.
81
+ *
82
+ * __Example:__
83
+ *
84
+ * const {Capabilities} = require('selenium-webdriver');
85
+ * const proxy = require('selenium-webdriver/lib/proxy');
86
+ *
87
+ * let capabilities = new Capabilities();
88
+ * capabilities.setProxy(proxy.socks('localhost:1234', 'bob', 'password'));
89
+ *
90
+ *
91
+ * @param {string } host The proxy host, in the form `hostname:port`.
92
+ * @param {string } username The user name to authenticate as.
93
+ * @param {string } password The password to authenticate with.
94
+ * @return {!ProxyConfig } A new proxy configuration object.
95
+ * @see https://en.wikipedia.org/wiki/SOCKS
96
+ */
97
+ exports . socks = function ( host , username , password ) {
98
+ return /** @type {!ProxyConfig } */ ( {
99
+ proxyType : 'manual' ,
100
+ socksProxy : host ,
101
+ socksUsername : username ,
102
+ socksPassword : password
103
+ } ) ;
104
+ } ;
105
+
106
+
79
107
/**
80
108
* Configures WebDriver to configure the browser proxy using the PAC file at
81
109
* the given URL.
You can’t perform that action at this time.
0 commit comments