Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
ef7e54be34 | |||
d800b6ed6e | |||
af42598464 | |||
93b1048cb7 |
42
package-lock.json
generated
42
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartproxy",
|
"name": "@pushrocks/smartproxy",
|
||||||
"version": "2.0.1",
|
"version": "2.0.3",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -96,9 +96,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/lik": {
|
"@pushrocks/lik": {
|
||||||
"version": "3.0.16",
|
"version": "3.0.19",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.16.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.19.tgz",
|
||||||
"integrity": "sha512-rvF4aJL6IRDZXNtSHwnkT+iXUj4peY928g7xpJh8hrFxABMbE89nH/fOBQ0m36IuI5dZBvbZv++2qiFOLsL+oA==",
|
"integrity": "sha512-N9uTtQmTJ/iZ/V7LMCKbVx/ZAmP+b8uId0pxV9Au9T0Ulu9wcg3vNpyTQARgdWfG+tI9Qc0NHgOEa9H5mbDcDA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/smartdelay": "^2.0.6",
|
"@pushrocks/smartdelay": "^2.0.6",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
@ -160,18 +160,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/smartevent": {
|
"@pushrocks/smartevent": {
|
||||||
"version": "2.0.3",
|
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartevent/-/smartevent-2.0.3.tgz",
|
|
||||||
"integrity": "sha512-x4B1mzzE6LrMATXsRLNuZpMTlB2JodL44MA4bF4FucU3SBBiWhFv3CFJRlO9B23SKZ1fwdJQrk2lT7YTUHXXJQ==",
|
|
||||||
"requires": {
|
|
||||||
"@pushrocks/smartpromise": "^2.0.5"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@pushrocks/smartpromise": {
|
|
||||||
"version": "2.0.5",
|
"version": "2.0.5",
|
||||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-2.0.5.tgz",
|
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartevent/-/smartevent-2.0.5.tgz",
|
||||||
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g=="
|
"integrity": "sha512-2cromUAgMFOLxi9IuAhDesWV4FGmsdNQV6k2OQZbH/0bMYeaCT5Q4IcMxb8J5F0S820XCXlwGdy5VP5M6L+hAA==",
|
||||||
}
|
"requires": {
|
||||||
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
|
"@pushrocks/smartrx": "^2.0.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pushrocks/smartexit": {
|
"@pushrocks/smartexit": {
|
||||||
@ -414,9 +408,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@tsclass/tsclass": {
|
"@tsclass/tsclass": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.10",
|
||||||
"resolved": "https://verdaccio.lossless.one/@tsclass%2ftsclass/-/tsclass-3.0.3.tgz",
|
"resolved": "https://verdaccio.lossless.one/@tsclass%2ftsclass/-/tsclass-3.0.10.tgz",
|
||||||
"integrity": "sha512-BsPx1VVyXPMMqfERTMoseRQof8kWZZqeHl74un8Ba0aBxZx4DeEgi6OBR1XroWb4Znv+yOP+QQKOwHAffkKvMQ==",
|
"integrity": "sha512-8rDOf1aIsG3229Fy4d4xjH00dPX32UrIL7qPvHtuSAkCDsb70k9wJ5Wn+fkHmPoukMsgGIABJjjWjVnLb8yZXw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@pushrocks/tapbundle": "^3.0.13"
|
"@pushrocks/tapbundle": "^3.0.13"
|
||||||
}
|
}
|
||||||
@ -497,9 +491,9 @@
|
|||||||
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "13.7.0",
|
"version": "13.7.4",
|
||||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-13.7.0.tgz",
|
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-13.7.4.tgz",
|
||||||
"integrity": "sha512-GnZbirvmqZUzMgkFn70c74OQpTTUcCzlhQliTzYjQMqg+hVKcDnxdL19Ne3UdYzdMA/+W3eb646FWn/ZaT1NfQ=="
|
"integrity": "sha512-oVeL12C6gQS/GAExndigSaLxTrKpQPxewx9bOcwfvJiJge4rr7wNaph4J+ns5hrmIV2as5qxqN8YKthn9qh0jw=="
|
||||||
},
|
},
|
||||||
"@types/portscanner": {
|
"@types/portscanner": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
@ -1456,9 +1450,9 @@
|
|||||||
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
|
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
|
||||||
},
|
},
|
||||||
"moment-timezone": {
|
"moment-timezone": {
|
||||||
"version": "0.5.27",
|
"version": "0.5.28",
|
||||||
"resolved": "https://verdaccio.lossless.one/moment-timezone/-/moment-timezone-0.5.27.tgz",
|
"resolved": "https://verdaccio.lossless.one/moment-timezone/-/moment-timezone-0.5.28.tgz",
|
||||||
"integrity": "sha512-EIKQs7h5sAsjhPCqN6ggx6cEbs94GK050254TIJySD1bzoM5JTYDwAU1IoVOeTOL6Gm27kYJ51/uuvq1kIlrbw==",
|
"integrity": "sha512-TDJkZvAyKIVWg5EtVqRzU97w0Rb0YVbfpqyjgu6GwXCAohVRqwZjf4fOzDE6p1Ch98Sro/8hQQi65WDXW5STPw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"moment": ">= 2.9.0"
|
"moment": ">= 2.9.0"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartproxy",
|
"name": "@pushrocks/smartproxy",
|
||||||
"version": "2.0.1",
|
"version": "2.0.3",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a proxy for handling high workloads of proxying",
|
"description": "a proxy for handling high workloads of proxying",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@ -16,19 +16,19 @@
|
|||||||
"@gitzone/tsbuild": "^2.1.17",
|
"@gitzone/tsbuild": "^2.1.17",
|
||||||
"@gitzone/tstest": "^1.0.28",
|
"@gitzone/tstest": "^1.0.28",
|
||||||
"@pushrocks/tapbundle": "^3.2.0",
|
"@pushrocks/tapbundle": "^3.2.0",
|
||||||
"@types/node": "^13.7.0",
|
"@types/node": "^13.7.4",
|
||||||
"tslint": "^6.0.0",
|
"tslint": "^6.0.0",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/lik": "^3.0.16",
|
"@pushrocks/lik": "^3.0.19",
|
||||||
"@pushrocks/smartnetwork": "^1.1.18",
|
"@pushrocks/smartnetwork": "^1.1.18",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
"@pushrocks/smartrequest": "^1.1.47",
|
"@pushrocks/smartrequest": "^1.1.47",
|
||||||
"@pushrocks/smartspawn": "^2.0.9",
|
"@pushrocks/smartspawn": "^2.0.9",
|
||||||
"@pushrocks/smartstring": "^3.0.18",
|
"@pushrocks/smartstring": "^3.0.18",
|
||||||
"@pushrocks/smartsystem": "^2.0.9",
|
"@pushrocks/smartsystem": "^2.0.9",
|
||||||
"@tsclass/tsclass": "^3.0.3",
|
"@tsclass/tsclass": "^3.0.10",
|
||||||
"@types/ws": "^7.2.1",
|
"@types/ws": "^7.2.1",
|
||||||
"ws": "^7.2.1"
|
"ws": "^7.2.1"
|
||||||
},
|
},
|
||||||
|
@ -18,6 +18,10 @@ a proxy for handling high workloads of proxying
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
## Contribution
|
||||||
|
|
||||||
|
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||||
|
|
||||||
|
|
||||||
## Contribution
|
## Contribution
|
||||||
|
|
||||||
|
@ -7,14 +7,13 @@ let httpServer: plugins.http.Server;
|
|||||||
const portProxyCalls = {
|
const portProxyCalls = {
|
||||||
start: async (portArg = 8000) => {
|
start: async (portArg = 8000) => {
|
||||||
httpServer = plugins.http.createServer((request, response) => {
|
httpServer = plugins.http.createServer((request, response) => {
|
||||||
|
|
||||||
const requestUrl = new URL(request.url, `http://${request.headers.host}`);
|
const requestUrl = new URL(request.url, `http://${request.headers.host}`);
|
||||||
const completeUrlWithoutProtocol = `${requestUrl.host}${requestUrl.pathname}${requestUrl.search}`;
|
const completeUrlWithoutProtocol = `${requestUrl.host}${requestUrl.pathname}${requestUrl.search}`;
|
||||||
const redirectUrl = `https://${completeUrlWithoutProtocol}`;
|
const redirectUrl = `https://${completeUrlWithoutProtocol}`;
|
||||||
console.log(`Got http request for http://${completeUrlWithoutProtocol}`);
|
console.log(`Got http request for http://${completeUrlWithoutProtocol}`);
|
||||||
console.log(`Redirecting to ${redirectUrl}`);
|
console.log(`Redirecting to ${redirectUrl}`);
|
||||||
response.writeHead(302, {
|
response.writeHead(302, {
|
||||||
'Location': redirectUrl
|
Location: redirectUrl
|
||||||
});
|
});
|
||||||
response.end();
|
response.end();
|
||||||
});
|
});
|
||||||
@ -25,8 +24,13 @@ const portProxyCalls = {
|
|||||||
host: 'localhost',
|
host: 'localhost',
|
||||||
port: 8001
|
port: 8001
|
||||||
});
|
});
|
||||||
from.pipe(to);
|
from.pipe(to)
|
||||||
to.pipe(from);
|
to.pipe(from)
|
||||||
|
from.on('error', () => { from.end(), to.end() });
|
||||||
|
to.on('error', () => { from.end(), to.end() });
|
||||||
|
from.on('close', () => {
|
||||||
|
to.end();
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.listen(portArg);
|
.listen(portArg);
|
||||||
console.log(`PortProxy -> OK: Now listening on port ${portArg}`);
|
console.log(`PortProxy -> OK: Now listening on port ${portArg}`);
|
||||||
|
Reference in New Issue
Block a user