Compare commits

...

172 Commits

Author SHA1 Message Date
04b13e53b9 3.0.42 2023-01-05 15:26:36 +01:00
f1a4fae704 fix(core): update 2023-01-05 15:26:36 +01:00
5ee5147606 3.0.41 2023-01-05 14:57:55 +01:00
748c6e14e4 fix(core): update 2023-01-05 14:57:54 +01:00
f018957de4 3.0.40 2023-01-04 15:59:59 +01:00
a6583b037c fix(core): update 2023-01-04 15:59:58 +01:00
3ab4144c9a 3.0.39 2023-01-04 15:59:32 +01:00
0d2885ace4 fix(core): update 2023-01-04 15:59:31 +01:00
1723275215 3.0.38 2022-08-06 22:42:05 +02:00
977d8b0310 fix(core): update 2022-08-06 22:42:05 +02:00
5bb065f82b 3.0.37 2022-08-04 17:16:27 +02:00
942b812f97 fix(core): update 2022-08-04 17:16:26 +02:00
59a025b308 3.0.36 2022-08-04 14:21:06 +02:00
458e7d6b58 fix(core): update 2022-08-04 14:21:05 +02:00
7b0f824d29 3.0.35 2022-08-01 18:40:45 +02:00
b5796b86d5 fix(core): update 2022-08-01 18:40:44 +02:00
1f8ea59221 3.0.34 2022-08-01 13:00:47 +02:00
d717568572 fix(core): update 2022-08-01 13:00:46 +02:00
28d050851f 3.0.33 2022-08-01 12:56:15 +02:00
acbd109985 fix(core): update 2022-08-01 12:56:14 +02:00
cc38a6d10e 3.0.32 2022-08-01 12:55:01 +02:00
748b07efe2 fix(core): update 2022-08-01 12:55:00 +02:00
be4fd0978a 3.0.31 2022-08-01 12:31:30 +02:00
4521010b82 fix(core): update 2022-08-01 12:31:29 +02:00
bd1f1a4c1c 3.0.30 2022-07-31 08:30:13 +02:00
d3bdd56660 fix(core): update 2022-07-31 08:30:13 +02:00
c38a7c4c32 3.0.29 2022-07-30 23:00:23 +02:00
858628196a fix(core): update 2022-07-30 23:00:23 +02:00
4910679058 3.0.28 2022-07-30 23:00:15 +02:00
97db2012ca fix(core): update 2022-07-30 23:00:15 +02:00
0ee13b4e06 3.0.27 2022-07-30 22:40:08 +02:00
21f5882fa3 fix(core): update 2022-07-30 22:40:08 +02:00
48b43f9f0d 3.0.26 2022-07-30 22:29:31 +02:00
d3d476fd53 fix(core): update 2022-07-30 22:29:31 +02:00
b80b8a0a20 3.0.25 2022-07-30 22:20:31 +02:00
384943f697 fix(core): update 2022-07-30 22:20:31 +02:00
e9239ed978 3.0.24 2022-07-30 21:29:35 +02:00
baf1844866 fix(core): update 2022-07-30 21:29:34 +02:00
0b3d7f8a06 3.0.23 2022-07-30 21:28:08 +02:00
c38a2745e9 fix(core): update 2022-07-30 21:28:08 +02:00
a0f39d1c5b 3.0.22 2022-07-30 21:25:27 +02:00
c67ac868a5 fix(core): update 2022-07-30 21:25:27 +02:00
90e1a0453e 3.0.21 2022-07-30 19:28:24 +02:00
d7765fb5dc fix(core): update 2022-07-30 19:28:23 +02:00
0fdd17b430 3.0.20 2022-07-30 18:53:21 +02:00
0562de6aa1 fix(core): update 2022-07-30 18:53:21 +02:00
7b550a35aa 3.0.19 2022-07-30 18:49:14 +02:00
fb66aac6e7 fix(core): update 2022-07-30 18:49:14 +02:00
208790cfcf 3.0.18 2022-07-30 18:29:21 +02:00
5978bbaf66 fix(core): update 2022-07-30 18:29:20 +02:00
1c47eafe5f 3.0.17 2022-07-30 17:32:59 +02:00
69e3a71354 fix(core): update 2022-07-30 17:32:58 +02:00
21e92bf0c1 3.0.16 2022-07-30 17:26:36 +02:00
d732e6e7aa fix(core): update 2022-07-30 17:26:35 +02:00
5fdfcdb407 3.0.15 2022-07-30 13:30:25 +02:00
49e2e90bda fix(core): update 2022-07-30 13:30:25 +02:00
b8e53e7b42 3.0.14 2022-07-30 08:20:21 +02:00
1136841b3d fix(core): update 2022-07-30 08:20:20 +02:00
42cbc51d22 3.0.13 2022-07-30 02:07:32 +02:00
2d16403ad1 fix(core): update 2022-07-30 02:07:31 +02:00
afe847499a 3.0.12 2022-07-30 01:57:42 +02:00
f980bb70b4 fix(core): update 2022-07-30 01:57:42 +02:00
f192a8f041 3.0.11 2022-07-29 16:12:18 +02:00
64bf3aef6d fix(core): update 2022-07-29 16:12:18 +02:00
a5e3cbd05b 3.0.10 2022-07-29 15:26:03 +02:00
2f0fad999a fix(core): update 2022-07-29 15:26:02 +02:00
5e6477720d 3.0.9 2022-07-29 15:22:32 +02:00
bad8bf0688 fix(core): update 2022-07-29 15:22:31 +02:00
4f1db106fb 3.0.8 2022-07-29 04:25:01 +02:00
d47829a8b2 fix(core): update 2022-07-29 04:25:01 +02:00
ca55d06244 3.0.7 2022-07-29 03:39:05 +02:00
7284924b26 fix(core): update 2022-07-29 03:39:05 +02:00
10857aa12b 3.0.6 2022-07-29 02:30:15 +02:00
c968c7f844 fix(core): update 2022-07-29 02:30:15 +02:00
b07015f6c4 3.0.5 2022-07-29 01:52:34 +02:00
ca4ddade17 fix(core): update 2022-07-29 01:52:34 +02:00
17eaea4124 3.0.4 2022-07-29 01:37:47 +02:00
d3d8f6ff57 fix(core): update 2022-07-29 01:37:47 +02:00
906661c7f4 3.0.3 2022-07-29 01:31:52 +02:00
ea46caebb7 fix(core): update 2022-07-29 01:31:52 +02:00
973e896fbf 3.0.2 2022-07-29 01:26:52 +02:00
4605035b01 fix(core): update 2022-07-29 01:26:51 +02:00
1e4e2c4ab6 3.0.1 2022-07-29 01:23:18 +02:00
30896b045f fix(core): update 2022-07-29 01:23:17 +02:00
08f382b9fa 3.0.0 2022-07-29 00:50:31 +02:00
1629dc1f5a BREAKING CHANGE(core): switch to esm 2022-07-29 00:50:30 +02:00
b33acdea41 2.0.16 2022-07-29 00:49:47 +02:00
101470dcd4 fix(core): update 2022-07-29 00:49:46 +02:00
ca73849541 2.0.15 2021-02-03 19:42:27 +00:00
b64523b0b2 fix(core): update 2021-02-03 19:42:27 +00:00
963ad6efa4 2.0.14 2021-02-03 15:11:55 +00:00
d271029302 fix(core): update 2021-02-03 15:11:55 +00:00
018fcbf71e 2.0.13 2021-02-03 11:19:57 +00:00
fa04732241 fix(core): update 2021-02-03 11:19:56 +00:00
da19fab8d8 2.0.12 2021-02-03 11:02:26 +00:00
8d318dca28 fix(core): update 2021-02-03 11:02:26 +00:00
d03bfcc793 2.0.11 2021-02-03 01:14:10 +00:00
4ba2686977 fix(core): update 2021-02-03 01:14:09 +00:00
d24c4d4b7a 2.0.10 2021-02-03 00:30:35 +00:00
e1d4d6cf38 fix(core): update 2021-02-03 00:30:35 +00:00
11344ac0df 2.0.9 2021-02-03 00:23:29 +00:00
85fcfc3c36 fix(core): update 2021-02-03 00:23:28 +00:00
e9ac7b2347 2.0.8 2021-02-03 00:16:11 +00:00
2c59540768 fix(core): update 2021-02-03 00:16:11 +00:00
0f82d63f5c 2.0.7 2021-02-03 00:13:30 +00:00
b5fcdadd3d fix(core): update 2021-02-03 00:13:29 +00:00
6168b07414 2.0.6 2021-02-02 21:59:55 +00:00
588179335a fix(core): update 2021-02-02 21:59:54 +00:00
703cbedad4 2.0.5 2021-02-02 21:59:25 +00:00
dd7e9e8416 fix(core): update 2021-02-02 21:59:24 +00:00
da060fa986 2.0.4 2021-02-02 15:55:26 +00:00
df001e13f3 fix(core): update 2021-02-02 15:55:25 +00:00
ef7e54be34 2.0.3 2021-02-02 00:53:58 +00:00
d800b6ed6e fix(core): update 2021-02-02 00:53:57 +00:00
af42598464 2.0.2 2020-02-23 19:04:53 +00:00
93b1048cb7 fix(core): update 2020-02-23 19:04:53 +00:00
29549b126e 2.0.1 2020-02-23 19:03:26 +00:00
736113eb4e fix(core): update 2020-02-23 19:03:25 +00:00
3b2d140836 2.0.0 2020-02-07 19:36:13 +00:00
70690f6400 BREAKING CHANGE(API): updateReversConfigs -> updateReverseConfigs 2020-02-07 19:36:12 +00:00
ae561e3e88 1.0.38 2020-02-07 16:06:12 +00:00
8a02a0c506 fix(core): update 2020-02-07 16:06:11 +00:00
58ec01526a 1.0.37 2020-02-07 13:04:12 +00:00
1c3619040c fix(core): update 2020-02-07 13:04:11 +00:00
0eabdcde28 1.0.36 2020-02-07 12:43:38 +00:00
3f935b3a03 fix(core): update 2020-02-07 12:43:37 +00:00
c7b8b6ff66 1.0.35 2019-11-03 03:06:56 +01:00
a9815c61d2 fix(core): update 2019-11-03 03:06:56 +01:00
82730877ce 1.0.34 2019-11-03 03:05:49 +01:00
b68b143a3f fix(core): update 2019-11-03 03:05:49 +01:00
3e7416574d 1.0.33 2019-11-03 03:04:23 +01:00
7f843bef50 fix(core): update 2019-11-03 03:04:23 +01:00
360c31c6b6 1.0.32 2019-09-29 17:18:41 +02:00
4ca748ec93 fix(core): update 2019-09-29 17:18:40 +02:00
6dd3e473c6 1.0.31 2019-09-29 01:06:07 +02:00
3856a1d7fb fix(core): update 2019-09-29 01:06:07 +02:00
fb76ecfd8a 1.0.30 2019-09-24 16:27:34 +02:00
6c84406574 fix(core): update 2019-09-24 16:27:34 +02:00
945065279f 1.0.29 2019-09-24 16:21:58 +02:00
07a8d9bec6 fix(websockets): now proxying websockets as well 2019-09-24 16:21:57 +02:00
2c55a6b819 1.0.28 2019-09-23 19:20:54 +02:00
8f4421fbc3 fix(core): update 2019-09-23 19:20:53 +02:00
5eebc434bb 1.0.27 2019-09-20 19:19:33 +02:00
ed03c3ec4b fix(core): update 2019-09-20 19:19:33 +02:00
06808cb2c9 1.0.26 2019-09-20 18:40:56 +02:00
ba3d4d4240 fix(core): update 2019-09-20 18:40:55 +02:00
9c49b9a9e5 1.0.25 2019-08-23 00:48:14 +02:00
f7259a6309 fix(core): update 2019-08-23 00:48:14 +02:00
7c4d9cf301 1.0.24 2019-08-23 00:41:39 +02:00
5ddee94f99 fix(core): update 2019-08-23 00:41:38 +02:00
209e5644c0 1.0.23 2019-08-22 16:22:20 +02:00
128c9f9751 fix(core): update 2019-08-22 16:22:19 +02:00
0dfb763b17 1.0.22 2019-08-22 16:14:50 +02:00
2883d2b926 fix(core): update 2019-08-22 16:14:50 +02:00
4113bf551e 1.0.21 2019-08-22 15:21:57 +02:00
2896c92c04 fix(core): update 2019-08-22 15:21:57 +02:00
f9e81ba7cd 1.0.20 2019-08-22 15:09:48 +02:00
8fcada6d4e fix(core): update 2019-08-22 15:09:48 +02:00
f43151916d 1.0.19 2019-08-22 13:20:51 +02:00
d416355ea1 fix(core): update 2019-08-22 13:20:50 +02:00
13c84f7146 1.0.18 2019-08-22 13:20:42 +02:00
3ddb4c4c75 fix(core): update 2019-08-22 13:20:41 +02:00
b39f607e63 1.0.17 2019-08-22 12:49:29 +02:00
793e108e7e fix(core): update 2019-08-22 12:49:29 +02:00
3238ea5cfd 1.0.16 2019-08-21 23:55:46 +02:00
20dc9238e4 fix(core): update 2019-08-21 23:55:45 +02:00
2b9b7cf691 1.0.15 2019-08-21 23:54:56 +02:00
0b7f5c4701 fix(core): update 2019-08-21 23:54:55 +02:00
23fa6a6511 1.0.14 2019-08-21 23:41:06 +02:00
ff8e185ec3 fix(core): update 2019-08-21 23:41:06 +02:00
c32a56d921 1.0.13 2019-08-21 15:09:33 +02:00
69233e8a3b fix(core): update 2019-08-21 15:09:32 +02:00
23 changed files with 5208 additions and 1948 deletions

4
.gitignore vendored
View File

@ -15,8 +15,6 @@ node_modules/
# builds
dist/
dist_web/
dist_serve/
dist_ts_web/
dist_*/
# custom

View File

@ -3,75 +3,82 @@ image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: "$CI_BUILD_STAGE"
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- metadata
- security
- test
- release
- metadata
before_script:
- npm install -g @shipzone/npmci
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
tags:
- docker
- notpriv
snyk:
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
- notpriv
- docker
allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=dev
tags:
- docker
allow_failure: true
# ====================
# test stage
# ====================
testLTS:
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- priv
- docker
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci command npm run build
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
- docker
release:
stage: release
script:
- npmci node install lts
- npmci npm publish
- npmci node install stable
- npmci npm publish
only:
- tags
- tags
tags:
- docker
- notpriv
- lossless
- docker
- notpriv
# ====================
# metadata stage
@ -79,35 +86,37 @@ release:
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g tslint typescript
- npmci command npm install -g typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- docker
- priv
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
- npmci trigger
only:
- tags
- tags
tags:
- docker
- notpriv
- lossless
- docker
- notpriv
pages:
image: hosttoday/ht-docker-dbase:npmci
services:
- docker:18-dind
stage: metadata
script:
- npmci command npm install -g @gitzone/tsdoc
- npmci node install stable
- npmci npm prepare
- npmci npm install
- npmci command tsdoc
- npmci command npm run buildDocs
tags:
- lossless
- docker
- notpriv
only:
@ -115,5 +124,5 @@ pages:
artifacts:
expire_in: 1 week
paths:
- public
- public
allow_failure: true

24
.vscode/launch.json vendored
View File

@ -2,28 +2,10 @@
"version": "0.2.0",
"configurations": [
{
"name": "current file",
"type": "node",
"command": "npm test",
"name": "Run npm test",
"request": "launch",
"args": [
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
"type": "node-terminal"
}
]
}

26
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,26 @@
{
"json.schemas": [
{
"fileMatch": ["/npmextra.json"],
"schema": {
"type": "object",
"properties": {
"npmci": {
"type": "object",
"description": "settings for npmci"
},
"gitzone": {
"type": "object",
"description": "settings for gitzone",
"properties": {
"projectType": {
"type": "string",
"enum": ["website", "element", "service", "npm", "wcc"]
}
}
}
}
}
}
]
}

View File

@ -1,10 +1,11 @@
{
"gitzone": {
"projectType": "npm",
"module": {
"githost": "gitlab.com",
"gitscope": "pushrocks",
"gitrepo": "smartproxy",
"shortDescription": "a proxy for handling high workloads of proxying",
"description": "a proxy for handling high workloads of proxying",
"npmPackagename": "@pushrocks/smartproxy",
"license": "MIT",
"projectDomain": "push.rocks"

1754
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,37 +1,49 @@
{
"name": "@pushrocks/smartproxy",
"version": "1.0.12",
"version": "3.0.42",
"private": false,
"description": "a proxy for handling high workloads of proxying",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
"author": "Lossless GmbH",
"license": "MIT",
"scripts": {
"test": "(tstest test/)",
"build": "(tsbuild)",
"format": "(gitzone format)"
"build": "(tsbuild --web --allowimplicitany)",
"format": "(gitzone format)",
"buildDocs": "tsdoc"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.0.22",
"@gitzone/tstest": "^1.0.15",
"@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^12.7.2",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.15.0"
"@gitzone/tsbuild": "^2.1.65",
"@gitzone/tsrun": "^1.2.39",
"@gitzone/tstest": "^1.0.73",
"@pushrocks/tapbundle": "^5.0.4",
"@types/node": "^18.7.8"
},
"dependencies": {
"@pushrocks/smartrequest": "^1.1.20"
"@pushrocks/lik": "^6.0.0",
"@pushrocks/smartdelay": "^2.0.13",
"@pushrocks/smartpromise": "^3.1.7",
"@pushrocks/smartrequest": "^2.0.10",
"@pushrocks/smartstring": "^4.0.2",
"@tsclass/tsclass": "^4.0.19",
"@types/ws": "^8.5.3",
"ws": "^8.8.1"
},
"files": [
"ts/*",
"ts_web/*",
"dist/*",
"dist_web/*",
"dist_ts_web/*",
"assets/*",
"ts/**/*",
"ts_web/**/*",
"dist/**/*",
"dist_*/**/*",
"dist_ts/**/*",
"dist_ts_web/**/*",
"assets/**/*",
"cli.js",
"npmextra.json",
"readme.md"
],
"browserslist": [
"last 1 chrome versions"
]
}

4341
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -8,16 +8,31 @@ a proxy for handling high workloads of proxying
* [docs (typedoc)](https://pushrocks.gitlab.io/smartproxy/)
## Status for master
[![build status](https://gitlab.com/pushrocks/smartproxy/badges/master/build.svg)](https://gitlab.com/pushrocks/smartproxy/commits/master)
[![coverage report](https://gitlab.com/pushrocks/smartproxy/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartproxy/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartproxy.svg)](https://www.npmjs.com/package/@pushrocks/smartproxy)
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartproxy/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartproxy)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartproxy/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartproxy/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartproxy)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartproxy)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartproxy)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartproxy)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartproxy)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
## 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
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). :)
For further information read the linked docs at the top of this readme.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)

27
test/cert.pem Normal file
View File

@ -0,0 +1,27 @@
-----BEGIN CERTIFICATE-----
MIIEljCCAn4CCQDY+ZbC9FASVjANBgkqhkiG9w0BAQsFADANMQswCQYDVQQGEwJE
RTAeFw0xOTA5MjAxNjAxNDRaFw0yMDA5MTkxNjAxNDRaMA0xCzAJBgNVBAYTAkRF
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA4thf9JEK/epoXt8hFr8t
pkRzmaEkgbSKoOga3uGXDLvdNf3BzSIxZ8pzRhZfUnutcmW1thdz3wre/pEJR7oN
QsfixbLL8/oS5QeXKiUGX0Ssfdg4W0TsoLcRva+1AZsf38MfiUPhzh1/UW/rMywW
asazQwRZdkkXb4nKJ2IFZx22qnAD4/5Sug+sfeKoFBF/rzI2yK7rognt7kW2LHv6
rswHnZ1Z2P/gbhlZ/EhG9hFVRZwRLDscWKcuWcxkePDt2J1pDNqD6SYa6ZjGC3AE
TJw5iEA1bLQ9YvjDNpVYcf6ZvcSilIFjSQu5cs9sUbHGeKTrS5HzfeJXh1PfJyL8
X0Hu7UBSjfSudso3baE9FGiBFBW2cnXZKDZGtV8eq/qxPetOOgS09pVbNP6508WV
BR+rz98/VDZLZqcbZ2UpOuz4+kAKmbYE9GplxKQZZO7wWEox7Mid/uUdcqEo4QKn
no6ujOuzQzn5a2oOS0k5Hk3uHapNJWlW9YI3LHtfADpYH+6cOR+/c3JWBzQJ6AD7
muvNzA9mWXeHqLxMMP4pkmb7otzZYrEkodUqJgAQxcYhGh6XsCPfJ/D9RN734OJc
gleVXFI8Kz455HxCW19XNfz16k7T6kqhZ/6SOBbkxEuqg7oEthAP109ZZzgx4oDo
hQsw24TjLkI4SPIc7nr60UUCAwEAATANBgkqhkiG9w0BAQsFAAOCAgEAu0+zrg0C
mlSv4Yi24OwB7TBvx+WHesl1IilCUdTiiUMo3Numv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M9DwwToOMtwH2np0ZiiAj+ENXgx+R1+95Gsiu79k5Cn6oZsqNhPkP+Bb
fba69M1EDnInmGloLyYDIbbFlsMwWhn7cn+lJYpfVJ9TK+0lMWoD1yAkUa4+DVDz
z2naf466wKWfnRvnEAVJcu+hqizxrqySzlH4GDNUhn7P/UJkGFkx+yUSGFUZdLsM
orfBWUCPXSzPttmXBJbO+Nr+rP+86KvgdI/AT0vYFNdINomEjxsfpaxjOAaW0wfz
8jCyWKoZ0gJNEeK32GO5UA7dcgBHD3vQWa3lijo8COsznboaJe7M6PQpa/2S2H3+
4P5msQKCAQEAx7NP3y+5ttfTd/eQ7/cg1/0y2WxvpOYNLt6MWz4rPWyD6QwidzTG
pjuQFQ5Ods+BwJ/Jbirb7l4GMAxfIbEPAkPTHpvswO0xcncSYxl0sSP/WIA6sbcM
dp7B/scdORC8Y6i8oPdCyxyCTd2SBrmGr2krAXmQquT72eusyP5E8HFhCy1iYt22
aL68dZLv9/sRAF08t9Wy+eYjD/hCj67t7uGCZQT8wJbKr8aJcjwVwJgghh+3EydK
h+7fBVO49PLL0NWy+8GT8y7a04calFfLvZEA2UMaunBis3dE1KMFfJL/0JO+sKnF
2TkK01XDDJURK5Lhuvc7WrK2rSJ/fK+0GA==
-----END PRIVATE KEY-----

View File

@ -1,9 +1,116 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartproxy from '../ts/index';
import * as smartproxy from '../ts/index.js';
let testProxy: smartproxy.NetworkProxy;
tap.test('first test', async () => {
const testProxy = new smartproxy.SmartProxy();
// await testProxy.start();
testProxy = new smartproxy.NetworkProxy({
port: 3001,
});
expect(testProxy).toBeInstanceOf(smartproxy.NetworkProxy);
});
tap.test('should start the testproxy', async () => {
await testProxy.start();
});
tap.test('should supply reverse proxy config', async () => {
testProxy.updateProxyConfigs([
{
destinationIp: '127.0.0.1',
destinationPort: '3000',
hostName: 'push.rocks',
privateKey: `-----BEGIN PRIVATE KEY-----
MIIJRQIBADANBgkqhkiG9w0BA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Nolhj
t2UXw9WB5B2xWvrqlNMy0F3NAZBkZ/+k21HZo6FmVi+q6OEGcOo7wJt6wrH/lko9
LxX96GC1JoN1Pfr2FoTKy1WHzrSfyGmDIUCrbaYQ58UuMOR+5eIPPdkf/030u5eX
xXhF2fBujD57E2zQGh/l2MrOjamcSo0+wYhOqlX3WNdaKNAzPqloBnF6w7eqLYde
h9He39ySmxjENwv3miOjEP1sBeMBSRfL/ckEonfK5uJgYA5nVMQ3ojUeDMZzLfFE
Ue2WHt+uPyYk7mMZfOrK2uHzI2/Coqj7lbfRodFwj+fCArYBck2NZannDPKA6X8V
TzJTbTCteOUUJTrcfZ0gGhGkF4nYLmX5OI+TPqrDJf0fZ+mzAEHzDDVXcBYpYRDr
r8d9QwrK+WaqVi2ofbMfMByVF72jgeJNa4nxwT9bVbu/Q1T2Lt+YPb4pQ7yCoUgS
JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
-----END CERTIFICATE-----
`,
},
]);
});
tap.test('should wait for 60 seconds', async (tools) => {
await tools.delayFor(10000);
});
tap.test('should close the testproxy', async () => {
await testProxy.stop();
});
tap.start();

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smartproxy',
version: '3.0.42',
description: 'a proxy for handling high workloads of proxying'
}

View File

@ -1 +1,3 @@
export * from './smartproxy.classes.smartproxy';
export * from './smartproxy.classes.networkproxy.js';
export * from './smartproxy.portproxy.js';
export * from './smartproxy.classes.sslredirect.js'

View File

@ -1,7 +0,0 @@
export interface IHostConfig {
hostName: string;
destinationIp: string;
destinationPort: number;
privateKey: string;
publicKey: string;
}

View File

@ -0,0 +1,363 @@
import * as plugins from './smartproxy.plugins.js';
import { ProxyRouter } from './smartproxy.classes.router.js';
export interface INetworkProxyOptions {
port: number;
}
export class NetworkProxy {
// INSTANCE
public options: INetworkProxyOptions;
public proxyConfigs: plugins.tsclass.network.IReverseProxyConfig[] = [];
public httpsServer: plugins.https.Server;
public router = new ProxyRouter();
public socketMap = new plugins.lik.ObjectMap<plugins.net.Socket>();
public defaultHeaders: { [key: string]: string } = {};
public alreadyAddedReverseConfigs: {
[hostName: string]: plugins.tsclass.network.IReverseProxyConfig;
} = {};
constructor(optionsArg: INetworkProxyOptions) {
this.options = optionsArg;
}
/**
* starts the proxyInstance
*/
public async start() {
this.httpsServer = plugins.https.createServer(
// ================
// Spotted this keypair in the code?
// Don't get exited:
// It is an invalid default keypair.
// For proper requests custom domain level keypairs are used that are provided in the reverse config
// ================
{
key: `-----BEGIN PRIVATE KEY-----
MIIJRQIBADANBgkqhkiG9w0BAQEFAASCCS8wggkrAgEAAoICAQDi2F/0kQr96mhe
3yEWvy2mRHOZoSSBtIqg6Bre4ZcMu901/cHNIjFnynNGFl9Se61yZbW2F3PfCt7+
kQlHug1Cx+LFssvz+hLlB5cqJQZfRKx92DhbROygtxG9r7UBmx/fwx+JQ+HOHX9R
b+szLBZqxrNDBFl2SRdviconYgVnHbaqcAPj/lK6D6x94qgUEX+vMjbIruuiCe3u
RbYse/quzAednVnY/+BuGVn8SEb2EVVFnBEsOxxYpy5ZzGR48O3YnWkM2oPpJhrp
mMYLcARMnDmIQDVstD1i+MM2lVhx/pm9xKKUgWNJC7lyz2xRscZ4pOtLkfN94leH
U98nIvxfQe7tQFKN9K52yjdtoT0UaIEUFbZyddkoNka1Xx6r+rE96046BLT2lVs0
/rnTxZUFH6vP3z9UNktmpxtnZSk67Pj6QAqZtgT0amXEpBlk7vBYSjHsyJ3+5R1y
oSjhAqeejq6M67NDOflrag5LSTkeTe4dqk0laVb1gjcse18AOlgf7pw5H79zclYH
NAnoAPua683MD2ZZd4eovEww/imSZvui3NlisSSh1SomABDFxiEaHpewI98n8P1E
3vfg4lyCV5VcUjwrPjnkfEJbX1c1/PXqTtPqSqFn/pI4FuTES6qDugS2EA/XT1ln
ODHigOiFCzDbhOMuQjhI8hzuevrRRQIDAQABAo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LxMMP4pkmb7otzZYrEkodUqJgAQxcYhGh6XsCPfJ/D9RN734OJc
gleVXFI8Kz455HxCW19XNfz16k7T6kqhZ/6SOBbkxEuqg7oEthAP109ZZzgx4oDo
hQsw24TjLkI4SPIc7nr60UUCAwEAATANBgkqhkiG9w0BAQsFAAOCAgEAu0+zrg0C
mlSv4Yi24OwB7TBvx+WHesl1IilCUdTiiUMo3NumvsU9Dr3Jkd0jGqYI0eyH4gIt
KrhAveXfEw7tAOEHiYicmAdIFtyzh++ZWb8mgbBeqij1MP/76Jv+cc0lUqpfRo/A
qytAsPAILuyL1o1jh28JHcq+v+WYn/FEhjUlH6emhGKGlsAjhUPjzK8MEshNolhj
t2UXw9WB5B2xWvrqlNMy0F3NAZBkZ/+k21HZo6FmVi+q6OEGcOo7wJt6wrH/lko9
LxX96GC1JoN1Pfr2FoTKy1WHzrSfyGmDIUCrbaYQ58UuMOR+5eIPPdkf/030u5eX
xXhF2fBujD57E2zQGh/l2MrOjamcSo0+wYhOqlX3WNdaKNAzPqloBnF6w7eqLYde
h9He39ySmxjENwv3miOjEP1sBeMBSRfL/ckEonfK5uJgYA5nVMQ3ojUeDMZzLfFE
Ue2WHt+uPyYk7mMZfOrK2uHzI2/Coqj7lbfRodFwj+fCArYBck2NZannDPKA6X8V
TzJTbTCteOUUJTrcfZ0gGhGkF4nYLmX5OI+TPqrDJf0fZ+mzAEHzDDVXcBYpYRDr
r8d9QwrK+WaqVi2ofbMfMByVF72jgeJNa4nxwT9bVbu/Q1T2Lt+YPb4pQ7yCoUgS
JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
-----END CERTIFICATE-----
`,
},
async (originRequest, originResponse) => {
/**
* endRequest function
* can be used to prematurely end a request
*/
const endOriginReqRes = (
statusArg: number = 404,
messageArg: string = 'This route is not available on this server.',
headers: plugins.http.OutgoingHttpHeaders = {}
) => {
originResponse.writeHead(statusArg, messageArg);
originResponse.end(messageArg);
if (originRequest.socket !== originResponse.socket) {
console.log('hey, something is strange.')
}
originResponse.destroy();
};
console.log(`got request: ${originRequest.headers.host}${plugins.url.parse(originRequest.url).path}`);
const destinationConfig = this.router.routeReq(originRequest);
if (!destinationConfig) {
console.log(`${originRequest.headers.host} can't be routed properly. Terminating request.`);
endOriginReqRes();
return;
}
// authentication
if (destinationConfig.authentication) {
const authInfo = destinationConfig.authentication;
switch (authInfo.type) {
case 'Basic':
const authHeader = originRequest.headers.authorization;
if (authHeader) {
if (!authHeader.includes('Basic ')) {
return endOriginReqRes(401, 'Authentication required', {
'WWW-Authenticate': 'Basic realm="Access to the staging site", charset="UTF-8"',
});
}
const authStringBase64 = originRequest.headers.authorization.replace('Basic ', '');
const authString: string = plugins.smartstring.base64.decode(authStringBase64);
const userPassArray = authString.split(':');
const user = userPassArray[0];
const pass = userPassArray[1];
if (user === authInfo.user && pass === authInfo.pass) {
console.log('request successfully authenticated');
} else {
return endOriginReqRes(403, 'Forbidden: Wrong credentials');
}
}
break;
default:
return endOriginReqRes(
403,
'Forbidden: unsupported authentication method configured. Please report to the admin.'
);
}
}
let destinationUrl: string;
if (destinationConfig) {
destinationUrl = `http://${destinationConfig.destinationIp}:${destinationConfig.destinationPort}${originRequest.url}`;
} else {
return endOriginReqRes();
}
console.log(destinationUrl);
const proxyResponse = await plugins.smartrequest.request(
destinationUrl,
{
method: originRequest.method,
headers: {
...originRequest.headers,
'X-Forwarded-Host': originRequest.headers.host,
'X-Forwarded-Proto': 'https'
},
keepAlive: true,
},
true, // lets make this streaming
(proxyRequest) => {
originRequest.on('data', (data) => {
proxyRequest.write(data);
});
originRequest.on('end', (data) => {
proxyRequest.end();
});
originRequest.on('error', () => {
proxyRequest.end();
});
originRequest.on('close', () => {
proxyRequest.end();
});
originRequest.on('timeout', () => {
proxyRequest.end();
originRequest.destroy();
});
proxyRequest.on('error', () => {
endOriginReqRes();
})
}
);
originResponse.statusCode = proxyResponse.statusCode;
console.log(proxyResponse.statusCode);
for (const defaultHeader of Object.keys(this.defaultHeaders)) {
originResponse.setHeader(defaultHeader, this.defaultHeaders[defaultHeader]);
}
for (const header of Object.keys(proxyResponse.headers)) {
originResponse.setHeader(header, proxyResponse.headers[header]);
}
proxyResponse.on('data', (data) => {
originResponse.write(data);
});
proxyResponse.on('end', () => {
originResponse.end();
});
proxyResponse.on('error', () => {
originResponse.destroy();
});
proxyResponse.on('close', () => {
originResponse.end();
});
proxyResponse.on('timeout', () => {
originResponse.end();
originResponse.destroy()
});
}
);
// Enable websockets
const wss = new plugins.ws.WebSocketServer({ server: this.httpsServer });
wss.on('connection', (ws: plugins.wsDefault, reqArg) => {
console.log(`got connection for wsc for ${reqArg.url}`);
let wscConnectedDeferred: plugins.smartpromise.Deferred<plugins.wsDefault>;
ws.on('message', async (message) => {
if (!wscConnectedDeferred) {
wscConnectedDeferred = plugins.smartpromise.defer();
const parsedUrl = plugins.url.parse(reqArg.url);
const wsc = new plugins.wsDefault(`${this.router.routeWs(reqArg)}${parsedUrl.path}`);
wsc.on('open', () => {
wscConnectedDeferred.resolve(wsc);
});
}
const wsc = await wscConnectedDeferred.promise;
wsc.emit('message', message);
wsc.on('message', (message) => {
ws.emit('message', message);
});
// handle closing
const cleanUp = () => {
ws.terminate();
wsc.terminate();
};
ws.on('close', (message) => {
cleanUp();
});
wsc.on('close', (message) => {
cleanUp();
});
});
});
this.httpsServer.keepAliveTimeout = 600 * 1000;
this.httpsServer.headersTimeout = 600 * 1000;
this.httpsServer.on('connection', (connection: plugins.net.Socket) => {
this.socketMap.add(connection);
console.log(`added connection. now ${this.socketMap.getArray().length} sockets connected.`);
const cleanupConnection = () => {
if (this.socketMap.checkForObject(connection)) {
this.socketMap.remove(connection);
console.log(`removed connection. ${this.socketMap.getArray().length} sockets remaining.`);
connection.destroy();
}
};
connection.on('close', () => {
cleanupConnection();
});
connection.on('error', () => {
cleanupConnection();
});
connection.on('end', () => {
cleanupConnection();
});
connection.on('timeout', () => {
cleanupConnection();
})
});
this.httpsServer.listen(this.options.port);
console.log(
`NetworkProxy -> OK: now listening for new connections on port ${this.options.port}`
);
}
public async updateProxyConfigs(proxyConfigsArg: plugins.tsclass.network.IReverseProxyConfig[]) {
console.log(`got new proxy configs`);
this.proxyConfigs = proxyConfigsArg;
this.router.setNewProxyConfigs(proxyConfigsArg);
for (const hostCandidate of this.proxyConfigs) {
// console.log(hostCandidate);
const existingHostNameConfig = this.alreadyAddedReverseConfigs[hostCandidate.hostName];
if (!existingHostNameConfig) {
this.alreadyAddedReverseConfigs[hostCandidate.hostName] = hostCandidate;
} else {
if (
existingHostNameConfig.publicKey === hostCandidate.publicKey &&
existingHostNameConfig.privateKey === hostCandidate.privateKey
) {
continue;
} else {
this.alreadyAddedReverseConfigs[hostCandidate.hostName] = hostCandidate;
}
}
this.httpsServer.addContext(hostCandidate.hostName, {
cert: hostCandidate.publicKey,
key: hostCandidate.privateKey,
});
this.httpsServer;
}
}
public async addDefaultHeaders(headersArg: { [key: string]: string }) {
for (const headerKey of Object.keys(headersArg)) {
this.defaultHeaders[headerKey] = headersArg[headerKey];
}
}
public async stop() {
const done = plugins.smartpromise.defer();
this.httpsServer.close(() => {
done.resolve();
});
await this.socketMap.forEach(async (socket) => {
socket.destroy();
});
await done.promise;
}
}

View File

@ -1,8 +1,32 @@
import * as plugins from './smartproxy.plugins';
import * as plugins from './smartproxy.plugins.js';
export class SmartproxyRouter {
export class ProxyRouter {
public reverseProxyConfigs: plugins.tsclass.network.IReverseProxyConfig[] = [];
public routeReq(req: plugins.http.IncomingMessage) {
return 'lossless.gmbh';
/**
* sets a new set of reverse configs to be routed to
* @param reverseCandidatesArg
*/
public setNewProxyConfigs(reverseCandidatesArg: plugins.tsclass.network.IReverseProxyConfig[]) {
this.reverseProxyConfigs = reverseCandidatesArg;
}
/**
* routes a request
*/
public routeReq(req: plugins.http.IncomingMessage): plugins.tsclass.network.IReverseProxyConfig {
const originalHost = req.headers.host;
const correspodingReverseProxyConfig = this.reverseProxyConfigs.find((reverseConfig) => {
return reverseConfig.hostName === originalHost;
});
return correspodingReverseProxyConfig;
}
public routeWs(wsReq: plugins.http.IncomingMessage) {
const originalHost = plugins.url.parse(wsReq.url).host;
const correspodingReverseProxyConfig = this.reverseProxyConfigs.find((reverseConfig) => {
return reverseConfig.hostName === originalHost;
});
return correspodingReverseProxyConfig.destinationIp;
}
}

View File

@ -1,56 +0,0 @@
import * as plugins from './smartproxy.plugins';
import * as interfaces from './interfaces';
import { SmartproxyRouter } from './smartproxy.classes.router';
import { Socket } from 'net';
export class SmartProxy {
public httpsServer: plugins.https.Server | plugins.http.Server;
public router = new SmartproxyRouter();
public hostCandidates: interfaces.IHostConfig[] = [];
public addHostCandidate(hostCandidate: interfaces.IHostConfig) {
// TODO search for old hostCandidates with that target
this.hostCandidates.push(hostCandidate);
}
/**
* starts the proxyInstance
*/
public async start() {
this.httpsServer = plugins.http.createServer(async (req, res) => {
req.headers.host = this.router.routeReq(req);
const response = await plugins.smartrequest.request(`https://${req.headers.host}${req.url}`, {
method: req.method,
headers: req.headers
}, true);
res.statusCode = response.statusCode;
for (const header of Object.keys(response.headers)) {
res.setHeader(header, response.headers[header]);
}
response.on('data', data => {
res.write(data);
});
response.on('end', () => {
res.end();
});
});
for (const hostCandidate of this.hostCandidates) {
/* this.httpsServer.addContext(hostCandidate.hostName, {
cert: hostCandidate.publicKey,
key: hostCandidate.privateKey
}); */
}
this.httpsServer.on('upgrade', (req, socket: Socket) => {
})
this.httpsServer.listen(3000);
}
public async update() {
await this.start();
}
}

View File

@ -0,0 +1,32 @@
import * as plugins from './smartproxy.plugins.js';
export class SslRedirect {
httpServer: plugins.http.Server;
port: number;
constructor(portArg: number) {
this.port = portArg;
}
public async start() {
this.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();
});
this.httpServer.listen(this.port);
}
public async stop() {
const done = plugins.smartpromise.defer();
this.httpServer.close(() => {
done.resolve();
});
await done.promise;
}
}

View File

@ -1,12 +1,27 @@
// 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 };
export { http, https, net, url };
// tsclass scope
import * as tsclass from '@tsclass/tsclass';
export { tsclass };
// pushrocks scope
import * as lik from '@pushrocks/lik';
import * as smartdelay from '@pushrocks/smartdelay';
import * as smartpromise from '@pushrocks/smartpromise';
import * as smartrequest from '@pushrocks/smartrequest';
import * as smartstring from '@pushrocks/smartstring';
export {
smartrequest
};
export { lik, smartdelay, smartrequest, smartpromise, smartstring };
// third party scope
import * as ws from 'ws';
import wsDefault from 'ws';
export { wsDefault, ws };

View File

@ -0,0 +1,70 @@
import * as plugins from './smartproxy.plugins.js';
import * as net from 'net';
export class PortProxy {
netServer: plugins.net.Server;
fromPort: number;
toPort: number;
constructor(fromPortArg: number, toPortArg: number) {
this.fromPort = fromPortArg;
this.toPort = toPortArg;
}
public async start() {
const cleanUpSockets = (from: plugins.net.Socket, to: plugins.net.Socket) => {
from.end();
to.end();
from.removeAllListeners();
to.removeAllListeners();
from.unpipe();
to.unpipe();
from.destroy();
to.destroy();
};
this.netServer = net
.createServer((from) => {
const to = net.createConnection({
host: 'localhost',
port: this.toPort,
});
from.setTimeout(120000);
from.pipe(to);
to.pipe(from);
from.on('error', () => {
cleanUpSockets(from, to);
});
to.on('error', () => {
cleanUpSockets(from, to);
});
from.on('close', () => {
cleanUpSockets(from, to);
});
to.on('close', () => {
cleanUpSockets(from, to);
});
from.on('timeout', () => {
cleanUpSockets(from, to);
});
to.on('timeout', () => {
cleanUpSockets(from, to);
});
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}`);
}
public async stop() {
const done = plugins.smartpromise.defer();
this.netServer.close(() => {
done.resolve();
});
await done.promise;
}
}

10
tsconfig.json Normal file
View File

@ -0,0 +1,10 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext",
"esModuleInterop": true
}
}

View File

@ -1,17 +0,0 @@
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}