diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 814e7f7..9d03282 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -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' } diff --git a/ts/smartproxy.classes.networkproxy.ts b/ts/smartproxy.classes.networkproxy.ts index b113834..234b94c 100644 --- a/ts/smartproxy.classes.networkproxy.ts +++ b/ts/smartproxy.classes.networkproxy.ts @@ -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; 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();