fix(core): update
This commit is contained in:
@ -7,6 +7,7 @@ export class ProxyWorker {
|
||||
public httpsServer: plugins.https.Server; // | plugins.http.Server;
|
||||
public port = 8001;
|
||||
public router = new SmartproxyRouter();
|
||||
public socketMap = new plugins.lik.Objectmap<plugins.net.Socket>();
|
||||
|
||||
/**
|
||||
* starts the proxyInstance
|
||||
@ -168,6 +169,14 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
|
||||
});
|
||||
this.httpsServer.keepAliveTimeout = 61000;
|
||||
this.httpsServer.headersTimeout = 65000;
|
||||
|
||||
this.httpsServer.on('connection', connection => {
|
||||
this.socketMap.add(connection);
|
||||
connection.on('close', () => {
|
||||
this.socketMap.remove(connection);
|
||||
});
|
||||
});
|
||||
|
||||
this.httpsServer.listen(this.port);
|
||||
console.log(`OK: now listening for new connections on port ${this.port}`);
|
||||
}
|
||||
@ -191,6 +200,9 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
|
||||
this.httpsServer.close(() => {
|
||||
done.resolve();
|
||||
});
|
||||
await this.socketMap.forEach(async (socket) => {
|
||||
socket.destroy();
|
||||
});
|
||||
await done.promise;
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,10 @@
|
||||
// node native scope
|
||||
import * as http from 'http';
|
||||
import * as https from 'https';
|
||||
import * as net from 'net';
|
||||
import * as url from 'url';
|
||||
|
||||
export { http, https, url };
|
||||
export { http, https, net, url };
|
||||
|
||||
// tsclass scope
|
||||
import * as tsclass from '@tsclass/tsclass';
|
||||
@ -11,12 +12,13 @@ import * as tsclass from '@tsclass/tsclass';
|
||||
export { tsclass };
|
||||
|
||||
// pushrocks scope
|
||||
import * as lik from '@pushrocks/lik';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
import * as smartrequest from '@pushrocks/smartrequest';
|
||||
import * as smartspawn from '@pushrocks/smartspawn';
|
||||
import * as smartsystem from '@pushrocks/smartsystem';
|
||||
|
||||
export { smartrequest, smartpromise, smartspawn, smartsystem };
|
||||
export { lik, smartrequest, smartpromise, smartspawn, smartsystem };
|
||||
|
||||
// third party scope
|
||||
import * as ws from 'ws';
|
||||
|
Reference in New Issue
Block a user