MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / constructor

Method constructor

javascript/selenium-webdriver/http/index.js:82–105  ·  view source on GitHub ↗

* @param {string} serverUrl URL for the WebDriver server to send commands to. * @param {http.Agent=} opt_agent The agent to use for each request. * Defaults to `http.globalAgent`. * @param {?string=} opt_proxy The proxy to use for the connection to the * server. Default is to use

(serverUrl, opt_agent, opt_proxy, client_options = {})

Source from the content-addressed store, hash-verified

80 * @param {?Object.<string,Object>} client_options
81 */
82 constructor(serverUrl, opt_agent, opt_proxy, client_options = {}) {
83 /** @private {http.Agent} */
84 this.agent_ = opt_agent || null
85
86 /**
87 * Base options for each request.
88 * @private {RequestOptions}
89 */
90 this.options_ = getRequestOptions(serverUrl)
91
92 /**
93 * client options, header overrides
94 */
95 this.client_options = client_options
96
97 /**
98 * sets keep-alive for the agent
99 * see https://stackoverflow.com/a/58332910
100 */
101 this.keepAlive = this.client_options['keep-alive']
102
103 /** @private {?RequestOptions} */
104 this.proxyOptions_ = opt_proxy ? getRequestOptions(opt_proxy) : null
105 }
106
107 get keepAlive() {
108 return this.agent_.keepAlive

Callers

nothing calls this directly

Calls 1

getRequestOptionsFunction · 0.85

Tested by

no test coverage detected