@journeyapps/https-proxy-socket 0.0.0-dev.6df47f0 → 0.0.0-dev.73fb7f7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -81
- package/lib/cjs/HttpsProxySocket.d.ts +5 -5
- package/lib/cjs/HttpsProxySocket.d.ts.map +1 -1
- package/lib/cjs/HttpsProxySocket.js +16 -26
- package/lib/cjs/HttpsProxySocket.js.map +1 -1
- package/lib/cjs/ProxyAgent.d.ts +11 -0
- package/lib/cjs/ProxyAgent.d.ts.map +1 -0
- package/lib/cjs/{proxyAgent.js → ProxyAgent.js} +21 -25
- package/lib/cjs/ProxyAgent.js.map +1 -0
- package/lib/cjs/createProxyAgent.d.ts +11 -0
- package/lib/cjs/createProxyAgent.d.ts.map +1 -0
- package/lib/cjs/createProxyAgent.js +14 -0
- package/lib/cjs/createProxyAgent.js.map +1 -0
- package/lib/cjs/index.d.ts +2 -3
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +2 -3
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/mongoPatch.js +3 -3
- package/lib/cjs/mongoPatch.js.map +1 -1
- package/lib/cjs/utils/parseOptions.d.ts +3 -0
- package/lib/cjs/utils/parseOptions.d.ts.map +1 -0
- package/lib/cjs/utils/parseOptions.js +16 -0
- package/lib/cjs/utils/parseOptions.js.map +1 -0
- package/lib/cjs/utils/setServername.d.ts +3 -0
- package/lib/cjs/utils/setServername.d.ts.map +1 -0
- package/lib/cjs/utils/setServername.js +47 -0
- package/lib/cjs/utils/setServername.js.map +1 -0
- package/lib/esm/HttpsProxySocket.d.ts +5 -5
- package/lib/esm/HttpsProxySocket.d.ts.map +1 -1
- package/lib/esm/HttpsProxySocket.js +57 -30
- package/lib/esm/HttpsProxySocket.js.map +1 -1
- package/lib/esm/ProxyAgent.d.ts +11 -0
- package/lib/esm/ProxyAgent.d.ts.map +1 -0
- package/lib/esm/ProxyAgent.js +67 -0
- package/lib/esm/ProxyAgent.js.map +1 -0
- package/lib/esm/bin/mongoReplicas.js +4 -2
- package/lib/esm/bin/mongoReplicas.js.map +1 -1
- package/lib/esm/createProxyAgent.d.ts +11 -0
- package/lib/esm/createProxyAgent.d.ts.map +1 -0
- package/lib/esm/createProxyAgent.js +14 -0
- package/lib/esm/createProxyAgent.js.map +1 -0
- package/lib/esm/index.d.ts +2 -3
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +18 -3
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/mongoPatch.js +41 -5
- package/lib/esm/mongoPatch.js.map +1 -1
- package/lib/esm/utils/parseOptions.d.ts +3 -0
- package/lib/esm/utils/parseOptions.d.ts.map +1 -0
- package/lib/esm/utils/parseOptions.js +16 -0
- package/lib/esm/utils/parseOptions.js.map +1 -0
- package/lib/esm/utils/setServername.d.ts +3 -0
- package/lib/esm/utils/setServername.d.ts.map +1 -0
- package/lib/esm/utils/setServername.js +47 -0
- package/lib/esm/utils/setServername.js.map +1 -0
- package/package.json +3 -3
- package/lib/cjs/proxyAgent.d.ts +0 -11
- package/lib/cjs/proxyAgent.d.ts.map +0 -1
- package/lib/cjs/proxyAgent.js.map +0 -1
- package/lib/cjs/tediousPatch.d.ts +0 -9
- package/lib/cjs/tediousPatch.d.ts.map +0 -1
- package/lib/cjs/tediousPatch.js +0 -24
- package/lib/cjs/tediousPatch.js.map +0 -1
- package/lib/esm/proxyAgent.d.ts +0 -11
- package/lib/esm/proxyAgent.d.ts.map +0 -1
- package/lib/esm/proxyAgent.js +0 -32
- package/lib/esm/proxyAgent.js.map +0 -1
- package/lib/esm/tediousPatch.d.ts +0 -9
- package/lib/esm/tediousPatch.d.ts.map +0 -1
- package/lib/esm/tediousPatch.js +0 -21
- package/lib/esm/tediousPatch.js.map +0 -1
package/lib/cjs/tediousPatch.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useProxyForTedious = useProxyForTedious;
|
|
4
|
-
const debug = require('debug')('https-proxy');
|
|
5
|
-
/**
|
|
6
|
-
* Replace the connection method on the tedious library (used by mssql)
|
|
7
|
-
* to connect via a proxy.
|
|
8
|
-
*
|
|
9
|
-
* @param proxy - the proxy to use
|
|
10
|
-
*/
|
|
11
|
-
function useProxyForTedious(proxy) {
|
|
12
|
-
const { Connector } = require('tedious/lib/connector');
|
|
13
|
-
Connector.prototype.execute = async function (cb) {
|
|
14
|
-
debug(`opening sql connection to ${this.options.host}:${this.options.port}`);
|
|
15
|
-
try {
|
|
16
|
-
const socket = await proxy.connect(this.options);
|
|
17
|
-
cb(null, socket);
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
cb(error);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=tediousPatch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tediousPatch.js","sourceRoot":"","sources":["../../src/tediousPatch.ts"],"names":[],"mappings":";;AASA,gDAWC;AAnBD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC;AAE9C;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,KAAuB;IACxD,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACvD,SAAS,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,WAAW,EAAO;QACnD,KAAK,CAAC,6BAA6B,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7E,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACjD,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACnB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,EAAE,CAAC,KAAK,CAAC,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/lib/esm/proxyAgent.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { HttpsProxySocket } from './HttpsProxySocket';
|
|
2
|
-
import agentBase from 'agent-base';
|
|
3
|
-
import * as tls from 'tls';
|
|
4
|
-
/**
|
|
5
|
-
* Construct an agent for http(s) requests. Mostly for testing purposes.
|
|
6
|
-
*
|
|
7
|
-
* @param proxy - the proxy to use
|
|
8
|
-
* @param options - to set additional TLS options for https requests, e.g. rejectUnauthorized
|
|
9
|
-
*/
|
|
10
|
-
export declare function proxyAgent(proxy: HttpsProxySocket, options?: tls.ConnectionOptions): agentBase.Agent;
|
|
11
|
-
//# sourceMappingURL=proxyAgent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxyAgent.d.ts","sourceRoot":"","sources":["../../src/proxyAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,iBAAiB,mBAsBlF"}
|
package/lib/esm/proxyAgent.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import agentBase from 'agent-base';
|
|
2
|
-
import * as tls from 'tls';
|
|
3
|
-
/**
|
|
4
|
-
* Construct an agent for http(s) requests. Mostly for testing purposes.
|
|
5
|
-
*
|
|
6
|
-
* @param proxy - the proxy to use
|
|
7
|
-
* @param options - to set additional TLS options for https requests, e.g. rejectUnauthorized
|
|
8
|
-
*/
|
|
9
|
-
export function proxyAgent(proxy, options) {
|
|
10
|
-
return agentBase(async (req, opts) => {
|
|
11
|
-
const socket = await proxy.connect(opts);
|
|
12
|
-
if (opts.secureEndpoint) {
|
|
13
|
-
// Upgrade to TLS
|
|
14
|
-
let tlsOptions = {
|
|
15
|
-
socket: socket,
|
|
16
|
-
servername: opts.servername || opts.host
|
|
17
|
-
};
|
|
18
|
-
if (typeof opts.rejectUnauthorized != 'undefined') {
|
|
19
|
-
// There's a difference between 'undefined' (equivalent of false) and "not set" (equivalent of true)
|
|
20
|
-
tlsOptions.rejectUnauthorized = opts.rejectUnauthorized;
|
|
21
|
-
}
|
|
22
|
-
Object.assign(tlsOptions, options);
|
|
23
|
-
const tlsSocket = tls.connect(tlsOptions);
|
|
24
|
-
return tlsSocket;
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
socket.resume();
|
|
28
|
-
return socket;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=proxyAgent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxyAgent.js","sourceRoot":"","sources":["../../src/proxyAgent.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAuB,EAAE,OAA+B;IACjF,OAAO,SAAS,CAAC,KAAK,EAAE,GAA4B,EAAE,IAAS,EAAE,EAAE;QACjE,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEzC,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,iBAAiB;YACjB,IAAI,UAAU,GAA0B;gBACtC,MAAM,EAAE,MAAM;gBACd,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI;aACzC,CAAC;YACF,IAAI,OAAO,IAAI,CAAC,kBAAkB,IAAI,WAAW,EAAE,CAAC;gBAClD,oGAAoG;gBACpG,UAAU,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;YAC1D,CAAC;YACD,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YACnC,MAAM,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YAC1C,OAAO,SAAS,CAAC;QACnB,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO,MAAM,CAAC;QAChB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { HttpsProxySocket } from './HttpsProxySocket';
|
|
2
|
-
/**
|
|
3
|
-
* Replace the connection method on the tedious library (used by mssql)
|
|
4
|
-
* to connect via a proxy.
|
|
5
|
-
*
|
|
6
|
-
* @param proxy - the proxy to use
|
|
7
|
-
*/
|
|
8
|
-
export declare function useProxyForTedious(proxy: HttpsProxySocket): void;
|
|
9
|
-
//# sourceMappingURL=tediousPatch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tediousPatch.d.ts","sourceRoot":"","sources":["../../src/tediousPatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,QAWzD"}
|
package/lib/esm/tediousPatch.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const debug = require('debug')('https-proxy');
|
|
2
|
-
/**
|
|
3
|
-
* Replace the connection method on the tedious library (used by mssql)
|
|
4
|
-
* to connect via a proxy.
|
|
5
|
-
*
|
|
6
|
-
* @param proxy - the proxy to use
|
|
7
|
-
*/
|
|
8
|
-
export function useProxyForTedious(proxy) {
|
|
9
|
-
const { Connector } = require('tedious/lib/connector');
|
|
10
|
-
Connector.prototype.execute = async function (cb) {
|
|
11
|
-
debug(`opening sql connection to ${this.options.host}:${this.options.port}`);
|
|
12
|
-
try {
|
|
13
|
-
const socket = await proxy.connect(this.options);
|
|
14
|
-
cb(null, socket);
|
|
15
|
-
}
|
|
16
|
-
catch (error) {
|
|
17
|
-
cb(error);
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=tediousPatch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tediousPatch.js","sourceRoot":"","sources":["../../src/tediousPatch.ts"],"names":[],"mappings":"AACA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAuB;IACxD,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACvD,SAAS,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,WAAW,EAAO;QACnD,KAAK,CAAC,6BAA6B,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7E,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACjD,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACnB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,EAAE,CAAC,KAAK,CAAC,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|