diff options
Diffstat (limited to 'deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/README.md')
-rw-r--r-- | deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/README.md | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/README.md b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/README.md index b62d9c84bc..5e0419cf9c 100644 --- a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/README.md +++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/https-proxy-agent/README.md @@ -42,13 +42,13 @@ console.log('using proxy server %j', proxy); // HTTPS endpoint for the proxy to connect to var endpoint = process.argv[2] || 'https://graph.facebook.com/tootallnate'; console.log('attempting to GET %j', endpoint); -var opts = url.parse(endpoint); +var options = url.parse(endpoint); // create an instance of the `HttpsProxyAgent` class with the proxy server information var agent = new HttpsProxyAgent(proxy); -opts.agent = agent; +options.agent = agent; -https.get(opts, function (res) { +https.get(options, function (res) { console.log('"response" event!', res.headers); res.pipe(process.stdout); }); @@ -71,13 +71,9 @@ var parsed = url.parse(endpoint); console.log('attempting to connect to WebSocket %j', endpoint); // create an instance of the `HttpsProxyAgent` class with the proxy server information -var opts = url.parse(proxy); +var options = url.parse(proxy); -// IMPORTANT! Set the `secureEndpoint` option to `false` when connecting -// over "ws://", but `true` when connecting over "wss://" -opts.secureEndpoint = parsed.protocol ? parsed.protocol == 'wss:' : false; - -var agent = new HttpsProxyAgent(opts); +var agent = new HttpsProxyAgent(options); // finally, initiate the WebSocket connection var socket = new WebSocket(endpoint, { agent: agent }); @@ -96,19 +92,19 @@ socket.on('message', function (data, flags) { API --- -### new HttpsProxyAgent(opts) +### new HttpsProxyAgent(Object options) The `HttpsProxyAgent` class implements an `http.Agent` subclass that connects to the specified "HTTP(s) proxy server" in order to proxy HTTPS and/or WebSocket requests. This is achieved by using the [HTTP `CONNECT` method][CONNECT]. -The `opts` argument may either be a string URI of the proxy server to use, or an +The `options` argument may either be a string URI of the proxy server to use, or an "options" object with more specific properties: * `host` - String - Proxy host to connect to (may use `hostname` as well). Required. * `port` - Number - Proxy port to connect to. Required. * `secureProxy` - Boolean - If `true`, then use TLS to connect to the proxy. Defaults to `false`. - * `secureEndpoint` - Boolean - If `true` then a TLS connection to the endpoint will be established on top of the proxy socket. Defaults to `true`. + * `headers` - Object - Additional HTTP headers to be sent on the HTTP CONNECT method. * Any other options given are passed to the `net.connect()`/`tls.connect()` functions. |