fix(core): update
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smartproxy',
|
||||
version: '3.0.4',
|
||||
version: '3.0.5',
|
||||
description: 'a proxy for handling high workloads of proxying'
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
export * from './smartproxy.classes.networkproxy.js'
|
||||
export * from './smartproxy.classes.networkproxy.js';
|
||||
export * from './smartproxy.portproxy.js';
|
||||
|
@ -6,7 +6,6 @@ export interface INetworkProxyOptions {
|
||||
}
|
||||
|
||||
export class NetworkProxy {
|
||||
|
||||
// INSTANCE
|
||||
public options: INetworkProxyOptions;
|
||||
public proxyConfigs: plugins.tsclass.network.IReverseProxyConfig[] = [];
|
||||
@ -248,7 +247,7 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
|
||||
});
|
||||
});
|
||||
this.httpsServer.keepAliveTimeout = 61000;
|
||||
this.httpsServer.headersTimeout = 65000;
|
||||
this.httpsServer.headersTimeout = 65000;
|
||||
|
||||
this.httpsServer.on('connection', (connection: plugins.net.Socket) => {
|
||||
connection.setTimeout(120000);
|
||||
@ -276,7 +275,9 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
|
||||
});
|
||||
|
||||
this.httpsServer.listen(this.options.port);
|
||||
console.log(`ProxyWorker -> OK: now listening for new connections on port ${this.options.port}`);
|
||||
console.log(
|
||||
`ProxyWorker -> OK: now listening for new connections on port ${this.options.port}`
|
||||
);
|
||||
}
|
||||
|
||||
public async updateProxyConfigs(proxyConfigsArg: plugins.tsclass.network.IReverseProxyConfig[]) {
|
||||
@ -310,9 +311,7 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
|
||||
this.httpsServer.listen(this.port); */
|
||||
}
|
||||
|
||||
public async addDefaultHeaders(headersArg: {
|
||||
[key: string]: string;
|
||||
}) {
|
||||
public async addDefaultHeaders(headersArg: { [key: string]: string }) {
|
||||
for (const headerKey of Object.keys(headersArg)) {
|
||||
this.defaultHeaders[headerKey] = headersArg[headerKey];
|
||||
}
|
||||
|
@ -9,10 +9,10 @@ export class PortProxy {
|
||||
|
||||
constructor(fromPortArg: number, toPortArg: number) {
|
||||
this.fromPort = fromPortArg;
|
||||
this.toPort = toPortArg
|
||||
this.toPort = toPortArg;
|
||||
}
|
||||
|
||||
public async start () {
|
||||
public async start() {
|
||||
httpServer = plugins.http.createServer((request, response) => {
|
||||
const requestUrl = new URL(request.url, `http://${request.headers.host}`);
|
||||
const completeUrlWithoutProtocol = `${requestUrl.host}${requestUrl.pathname}${requestUrl.search}`;
|
||||
@ -34,7 +34,7 @@ export class PortProxy {
|
||||
to.unpipe();
|
||||
from.destroy();
|
||||
to.destroy();
|
||||
}
|
||||
};
|
||||
netServer = net
|
||||
.createServer((from) => {
|
||||
const to = net.createConnection({
|
||||
@ -64,10 +64,10 @@ export class PortProxy {
|
||||
});
|
||||
from.on('end', () => {
|
||||
cleanUpSockets(from, to);
|
||||
})
|
||||
});
|
||||
to.on('end', () => {
|
||||
cleanUpSockets(from, to);
|
||||
})
|
||||
});
|
||||
})
|
||||
.listen(this.fromPort);
|
||||
console.log(`PortProxy -> OK: Now listening on port ${this.fromPort}`);
|
||||
@ -82,4 +82,4 @@ export class PortProxy {
|
||||
});
|
||||
await done.promise;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user