Compare commits

...

6 Commits

Author SHA1 Message Date
32c6d77178 3.0.51 2023-01-05 19:33:16 +01:00
2c4316d2d3 fix(core): update 2023-01-05 19:33:15 +01:00
62e6387c1d 3.0.50 2023-01-05 19:21:03 +01:00
7fe22e962a fix(core): update 2023-01-05 19:21:02 +01:00
3f1f718308 3.0.49 2023-01-05 18:31:55 +01:00
ce94d283c1 fix(core): update 2023-01-05 18:31:55 +01:00
3 changed files with 8 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartproxy",
"version": "3.0.48",
"version": "3.0.51",
"private": false,
"description": "a proxy for handling high workloads of proxying",
"main": "dist_ts/index.js",

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartproxy',
version: '3.0.48',
version: '3.0.51',
description: 'a proxy for handling high workloads of proxying'
}

View File

@ -253,9 +253,11 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
ws.on('message', async (message) => {
if (!wscConnectedDeferred) {
wscConnectedDeferred = plugins.smartpromise.defer();
let wsc;
let wsc: plugins.wsDefault;
try {
wsc = new plugins.wsDefault(`wss://${this.router.routeReq(reqArg).destinationIp}:${this.router.routeReq(reqArg).destinationPort}${reqArg.url}`);
wsc = new plugins.wsDefault(`ws://${this.router.routeReq(reqArg).destinationIp}:${this.router.routeReq(reqArg).destinationPort}${reqArg.url}`, {
headers: reqArg.headers
});
} catch (err) {
console.log(err);
ws.terminate();
@ -267,9 +269,9 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
});
}
const wsc = await wscConnectedDeferred.promise;
wsc.emit('message', message);
wsc.send(message);
wsc.on('message', (message) => {
ws.emit('message', message);
ws.send(message);
});
// handle closing