Compare commits

...

2 Commits

Author SHA1 Message Date
0cc7184e58 3.0.52 2023-01-05 20:15:17 +01:00
392e241208 fix(core): update 2023-01-05 20:15:16 +01:00
3 changed files with 7 additions and 8 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartproxy",
"version": "3.0.51",
"version": "3.0.52",
"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.51',
version: '3.0.52',
description: 'a proxy for handling high workloads of proxying'
}

View File

@ -247,7 +247,7 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
// Enable websockets
const wss = new plugins.ws.WebSocketServer({ server: this.httpsServer });
wss.on('connection', (ws: plugins.wsDefault, reqArg: plugins.http.IncomingMessage) => {
console.log(`got connection for wsc for https://${reqArg.headers.host}${reqArg.url}`);
console.log(`wss: got connection for wsc for https://${reqArg.headers.host}${reqArg.url}`);
let wscConnectedDeferred: plugins.smartpromise.Deferred<plugins.wsDefault>;
ws.on('message', async (message) => {
@ -263,17 +263,16 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
ws.terminate();
return;
}
wsc.on('open', () => {
console.log('wsc opened.');
wscConnectedDeferred.resolve(wsc);
});
wsc.on('message', (message) => {
ws.send(message);
});
}
const wsc = await wscConnectedDeferred.promise;
wsc.send(message);
wsc.on('message', (message) => {
ws.send(message);
});
// handle closing
const cleanUp = () => {
ws.terminate();