@@ -16,23 +16,26 @@ but adapted to expose raw Sockets, instead of just http/https requests.
1616
1717 // Proxy connection options
1818 const proxy = new HttpsProxySocket('https://my-proxy.test', {
19- // Additional options for the proxy may be set here, for example:
19+ // Proxy auth and headers may be set here, for example:
2020 auth: 'myuser:mypassword' // Basic auth
2121 });
2222
2323 const agent = proxy.agent({
2424 // Additional TLS options for the host may be set here, for example:
25- // rejectUnauthorized: false
25+ // rejectUnauthorized: false, // Disable TLS checks completely (dangerous)
26+ // ca: fs.readFileSync('my-ca-cert.pem') // Use a custom CA cert
27+
28+ // Documentation of the available options is available here:
29+ // https://nodejs.org/api/tls.html#tls_new_tls_tlssocket_socket_options
30+ // https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options
2631 });
2732
2833 const response = await fetch('https://myhost.test', { agent: agent });
2934
3035## Usage - Direct socket
3136
3237 const { HttpsProxySocket } = require('@journeyapps/https-proxy-socket');
33- const proxy = new HttpsProxySocket('https://my-proxy.test', {
34- auth: 'myuser:mypassword' // Optional: proxy basic auth
35- });
38+ const proxy = new HttpsProxySocket('https://my-proxy.test');
3639
3740 const socket = await proxy.connect({host: 'myhost.test', port: 1234});
3841
0 commit comments