Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
10857aa12b | |||
c968c7f844 |
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartproxy",
|
"name": "@pushrocks/smartproxy",
|
||||||
"version": "3.0.5",
|
"version": "3.0.6",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@pushrocks/smartproxy",
|
"name": "@pushrocks/smartproxy",
|
||||||
"version": "3.0.5",
|
"version": "3.0.6",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/lik": "^6.0.0",
|
"@pushrocks/lik": "^6.0.0",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartproxy",
|
"name": "@pushrocks/smartproxy",
|
||||||
"version": "3.0.5",
|
"version": "3.0.6",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a proxy for handling high workloads of proxying",
|
"description": "a proxy for handling high workloads of proxying",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -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'
|
||||||
}
|
}
|
||||||
|
@ -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 }) {
|
||||||
|
@ -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();
|
||||||
|
Reference in New Issue
Block a user