fix(core): update
This commit is contained in:
parent
32c6d77178
commit
392e241208
@ -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'
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user