fix(core): update

This commit is contained in:
Philipp Kunz 2022-07-29 02:30:15 +02:00
parent b07015f6c4
commit c968c7f844
3 changed files with 1 additions and 15 deletions

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@pushrocks/smartproxy', name: '@pushrocks/smartproxy',
version: '3.0.5', version: '3.0.6',
description: 'a proxy for handling high workloads of proxying' description: 'a proxy for handling high workloads of proxying'
} }

View File

@ -307,8 +307,6 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
}); });
this.httpsServer; this.httpsServer;
} }
/* this.httpsServer.close();
this.httpsServer.listen(this.port); */
} }
public async addDefaultHeaders(headersArg: { [key: string]: string }) { public async addDefaultHeaders(headersArg: { [key: string]: string }) {

View File

@ -13,18 +13,6 @@ export class PortProxy {
} }
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}`;
const redirectUrl = `https://${completeUrlWithoutProtocol}`;
console.log(`Got http request for http://${completeUrlWithoutProtocol}`);
console.log(`Redirecting to ${redirectUrl}`);
response.writeHead(302, {
Location: redirectUrl,
});
response.end();
});
httpServer.listen(this.fromPort);
const cleanUpSockets = (from: plugins.net.Socket, to: plugins.net.Socket) => { const cleanUpSockets = (from: plugins.net.Socket, to: plugins.net.Socket) => {
from.end(); from.end();
to.end(); to.end();