@push.rocks/smartproxy 3.0.58 → 3.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,38 @@
1
+ import * as plugins from './smartproxy.plugins.js';
2
+ import './smartproxy.classes.proxyworker.js';
3
+ import './smartproxy.portproxy.js';
4
+ export class SmartProxy {
5
+ constructor(optionsArg = {}) {
6
+ this.smartsystem = new plugins.smartsystem.Smartsystem();
7
+ this.reverseConfigs = [];
8
+ this.options = optionsArg;
9
+ }
10
+ async updateReverseConfigs(reverseConfigsArg) {
11
+ // TODO search for old hostCandidates with that target
12
+ this.reverseConfigs = reverseConfigsArg;
13
+ if (this.proxyWorkerFunctions) {
14
+ await this.proxyWorkerFunctions.updateReverseConfigs(this.reverseConfigs);
15
+ }
16
+ }
17
+ async start() {
18
+ this.proxyWorkerFunctions = await plugins.smartspawn.spawn(new plugins.smartspawn.Worker('./smartproxy.classes.proxyworker'));
19
+ this.proxyWorkerFunctions.updateReverseConfigs(this.reverseConfigs);
20
+ this.portProxyFunctions = await plugins.smartspawn.spawn(new plugins.smartspawn.Worker('./smartproxy.portproxy'));
21
+ await this.portProxyFunctions.start(this.options.port);
22
+ await this.proxyWorkerFunctions.start();
23
+ console.log('successfully spawned portproxy and proxyworkers!');
24
+ }
25
+ async updateDefaultHeaders(defaultHeadersArg) {
26
+ await this.proxyWorkerFunctions.addDefaultHeaders(defaultHeadersArg);
27
+ }
28
+ async stop() {
29
+ await this.proxyWorkerFunctions.stop();
30
+ await plugins.smartspawn.Thread.terminate(this.proxyWorkerFunctions);
31
+ console.log('proxy worker stopped');
32
+ await this.portProxyFunctions.stop();
33
+ await plugins.smartspawn.Thread.terminate(this.portProxyFunctions);
34
+ console.log('portproxy stopped');
35
+ console.log('Terminated all childs!');
36
+ }
37
+ }
38
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRwcm94eS5jbGFzc2VzL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FDLENBQUM7SUFDeEMsQ0FBQztDQUNGIn0=
@@ -5,11 +5,11 @@ import * as url from 'url';
5
5
  export { http, https, net, url };
6
6
  import * as tsclass from '@tsclass/tsclass';
7
7
  export { tsclass };
8
- import * as lik from '@pushrocks/lik';
9
- import * as smartdelay from '@pushrocks/smartdelay';
10
- import * as smartpromise from '@pushrocks/smartpromise';
11
- import * as smartrequest from '@pushrocks/smartrequest';
12
- import * as smartstring from '@pushrocks/smartstring';
8
+ import * as lik from '@push.rocks/lik';
9
+ import * as smartdelay from '@push.rocks/smartdelay';
10
+ import * as smartpromise from '@push.rocks/smartpromise';
11
+ import * as smartrequest from '@push.rocks/smartrequest';
12
+ import * as smartstring from '@push.rocks/smartstring';
13
13
  export { lik, smartdelay, smartrequest, smartpromise, smartstring };
14
14
  import * as ws from 'ws';
15
15
  import wsDefault from 'ws';
@@ -8,14 +8,14 @@ export { http, https, net, url };
8
8
  import * as tsclass from '@tsclass/tsclass';
9
9
  export { tsclass };
10
10
  // pushrocks scope
11
- import * as lik from '@pushrocks/lik';
12
- import * as smartdelay from '@pushrocks/smartdelay';
13
- import * as smartpromise from '@pushrocks/smartpromise';
14
- import * as smartrequest from '@pushrocks/smartrequest';
15
- import * as smartstring from '@pushrocks/smartstring';
11
+ import * as lik from '@push.rocks/lik';
12
+ import * as smartdelay from '@push.rocks/smartdelay';
13
+ import * as smartpromise from '@push.rocks/smartpromise';
14
+ import * as smartrequest from '@push.rocks/smartrequest';
15
+ import * as smartstring from '@push.rocks/smartstring';
16
16
  export { lik, smartdelay, smartrequest, smartpromise, smartstring };
17
17
  // third party scope
18
18
  import * as ws from 'ws';
19
19
  import wsDefault from 'ws';
20
20
  export { wsDefault, ws };
21
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRwcm94eS5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRwcm94eS5wbHVnaW5zLn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 +2,33 @@
2
2
  "gitzone": {
3
3
  "projectType": "npm",
4
4
  "module": {
5
- "githost": "gitlab.com",
6
- "gitscope": "pushrocks",
5
+ "githost": "code.foss.global",
6
+ "gitscope": "push.rocks",
7
7
  "gitrepo": "smartproxy",
8
8
  "description": "a proxy for handling high workloads of proxying",
9
- "npmPackagename": "@pushrocks/smartproxy",
9
+ "npmPackagename": "@push.rocks/smartproxy",
10
10
  "license": "MIT",
11
- "projectDomain": "push.rocks"
11
+ "projectDomain": "push.rocks",
12
+ "keywords": [
13
+ "proxy",
14
+ "network traffic",
15
+ "high workload",
16
+ "http",
17
+ "https",
18
+ "websocket",
19
+ "network routing",
20
+ "ssl redirect",
21
+ "port mapping",
22
+ "reverse proxy",
23
+ "authentication"
24
+ ]
12
25
  }
13
26
  },
14
27
  "npmci": {
15
28
  "npmGlobalTools": [],
16
29
  "npmAccessLevel": "public"
30
+ },
31
+ "tsdoc": {
32
+ "legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
17
33
  }
18
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@push.rocks/smartproxy",
3
- "version": "3.0.58",
3
+ "version": "3.0.61",
4
4
  "private": false,
5
5
  "description": "a proxy for handling high workloads of proxying",
6
6
  "main": "dist_ts/index.js",
@@ -8,28 +8,22 @@
8
8
  "type": "module",
9
9
  "author": "Lossless GmbH",
10
10
  "license": "MIT",
11
- "scripts": {
12
- "test": "(tstest test/)",
13
- "build": "(tsbuild --web --allowimplicitany)",
14
- "format": "(gitzone format)",
15
- "buildDocs": "tsdoc"
16
- },
17
11
  "devDependencies": {
18
- "@gitzone/tsbuild": "^2.1.65",
19
- "@gitzone/tsrun": "^1.2.39",
20
- "@gitzone/tstest": "^1.0.73",
21
- "@pushrocks/tapbundle": "^5.0.4",
22
- "@types/node": "^18.7.8"
12
+ "@gitzone/tsbuild": "^2.1.66",
13
+ "@gitzone/tsrun": "^1.2.44",
14
+ "@gitzone/tstest": "^1.0.77",
15
+ "@push.rocks/tapbundle": "^5.0.12",
16
+ "@types/node": "^20.4.5"
23
17
  },
24
18
  "dependencies": {
25
- "@pushrocks/lik": "^6.0.0",
26
- "@pushrocks/smartdelay": "^2.0.13",
27
- "@pushrocks/smartpromise": "^3.1.7",
28
- "@pushrocks/smartrequest": "^2.0.10",
29
- "@pushrocks/smartstring": "^4.0.2",
30
- "@tsclass/tsclass": "^4.0.19",
31
- "@types/ws": "^8.5.3",
32
- "ws": "^8.8.1"
19
+ "@push.rocks/lik": "^6.0.3",
20
+ "@push.rocks/smartdelay": "^3.0.5",
21
+ "@push.rocks/smartpromise": "^4.0.3",
22
+ "@push.rocks/smartrequest": "^2.0.18",
23
+ "@push.rocks/smartstring": "^4.0.7",
24
+ "@tsclass/tsclass": "^4.0.42",
25
+ "@types/ws": "^8.5.5",
26
+ "ws": "^8.13.0"
33
27
  },
34
28
  "files": [
35
29
  "ts/**/*",
@@ -45,5 +39,29 @@
45
39
  ],
46
40
  "browserslist": [
47
41
  "last 1 chrome versions"
48
- ]
42
+ ],
43
+ "keywords": [
44
+ "proxy",
45
+ "network traffic",
46
+ "high workload",
47
+ "http",
48
+ "https",
49
+ "websocket",
50
+ "network routing",
51
+ "ssl redirect",
52
+ "port mapping",
53
+ "reverse proxy",
54
+ "authentication"
55
+ ],
56
+ "homepage": "https://code.foss.global/push.rocks/smartproxy",
57
+ "repository": {
58
+ "type": "git",
59
+ "url": "https://code.foss.global/push.rocks/smartproxy.git"
60
+ },
61
+ "scripts": {
62
+ "test": "(tstest test/)",
63
+ "build": "(tsbuild --web --allowimplicitany)",
64
+ "format": "(gitzone format)",
65
+ "buildDocs": "tsdoc"
66
+ }
49
67
  }
@@ -0,0 +1 @@
1
+
package/readme.md CHANGED
@@ -1,41 +1,118 @@
1
- # @pushrocks/smartproxy
2
- a proxy for handling high workloads of proxying
3
-
4
- ## Availabililty and Links
5
- * [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartproxy)
6
- * [gitlab.com (source)](https://gitlab.com/pushrocks/smartproxy)
7
- * [github.com (source mirror)](https://github.com/pushrocks/smartproxy)
8
- * [docs (typedoc)](https://pushrocks.gitlab.io/smartproxy/)
9
-
10
- ## Status for master
11
-
12
- Status Category | Status Badge
13
- -- | --
14
- GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartproxy/badges/master/pipeline.svg)](https://lossless.cloud)
15
- GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartproxy/badges/master/coverage.svg)](https://lossless.cloud)
16
- npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartproxy)](https://lossless.cloud)
17
- Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartproxy)](https://lossless.cloud)
18
- TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
19
- node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
20
- Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
21
- PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartproxy)](https://lossless.cloud)
22
- PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartproxy)](https://lossless.cloud)
23
- BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartproxy)](https://lossless.cloud)
24
- 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)
1
+ # @push.rocks/smartproxy
2
+ A proxy for handling high workloads of proxying.
3
+
4
+ ## Install
5
+ To install `@push.rocks/smartproxy`, run the following command in your project's root directory:
6
+
7
+ ```bash
8
+ npm install @push.rocks/smartproxy --save
9
+ ```
10
+
11
+ This will add `@push.rocks/smartproxy` to your project's dependencies.
25
12
 
26
13
  ## Usage
27
14
 
28
- ## Contribution
15
+ `@push.rocks/smartproxy` is a versatile package for setting up and handling proxies with various capabilities such as SSL redirection, port proxying, and creating network proxies with complex routing rules. Below is a comprehensive guide on using its features.
16
+
17
+ ### Setting Up a Network Proxy
18
+
19
+ Create a network proxy to route incoming HTTPS requests to different local servers based on the hostname.
20
+
21
+ ```typescript
22
+ import { NetworkProxy } from '@push.rocks/smartproxy';
23
+
24
+ // Instantiate the NetworkProxy with desired options
25
+ const myNetworkProxy = new NetworkProxy({ port: 443 });
26
+
27
+ // Define your reverse proxy configurations
28
+ const proxyConfigs = [
29
+ {
30
+ destinationIp: '127.0.0.1',
31
+ destinationPort: '3000',
32
+ hostName: 'example.com',
33
+ privateKey: `-----BEGIN PRIVATE KEY-----
34
+ PRIVATE_KEY_CONTENT
35
+ -----END PRIVATE KEY-----`,
36
+ publicKey: `-----BEGIN CERTIFICATE-----
37
+ CERTIFICATE_CONTENT
38
+ -----END CERTIFICATE-----`,
39
+ },
40
+ // Add more reverse proxy configurations here
41
+ ];
42
+
43
+ // Start the network proxy
44
+ await myNetworkProxy.start();
45
+
46
+ // Update proxy configurations dynamically
47
+ await myNetworkProxy.updateProxyConfigs(proxyConfigs);
48
+
49
+ // Optionally, add default headers to all responses
50
+ await myNetworkProxy.addDefaultHeaders({
51
+ 'X-Powered-By': 'smartproxy',
52
+ });
53
+ ```
54
+
55
+ ### Port Proxying
56
+
57
+ You can also set up a port proxy to forward traffic from one port to another, which is useful for dynamic port forwarding scenarios.
58
+
59
+ ```typescript
60
+ import { PortProxy } from '@push.rocks/smartproxy';
61
+
62
+ // Create a PortProxy to forward traffic from port 5000 to port 3000
63
+ const myPortProxy = new PortProxy(5000, 3000);
64
+
65
+ // Start the port proxy
66
+ await myPortProxy.start();
67
+
68
+ // To stop the port proxy, simply call
69
+ await myPortProxy.stop();
70
+ ```
71
+
72
+ ### Enabling SSL Redirection
73
+
74
+ Easily redirect HTTP traffic to HTTPS using the `SslRedirect` class. This is particularly useful when ensuring all traffic uses encryption.
75
+
76
+ ```typescript
77
+ import { SslRedirect } from '@push.rocks/smartproxy';
78
+
79
+ // Instantiate the SslRedirect on port 80 (HTTP)
80
+ const mySslRedirect = new SslRedirect(80);
81
+
82
+ // Start listening and redirecting to HTTPS
83
+ await mySslRedirect.start();
84
+
85
+ // To stop the redirection, use
86
+ await mySslRedirect.stop();
87
+ ```
88
+
89
+ ### Advanced Usage
90
+
91
+ The package integrates seamlessly with TypeScript, allowing for advanced use cases, such as implementing custom routing logic, authentication mechanisms, and handling WebSocket connections through the network proxy.
92
+
93
+ For a more advanced setup involving WebSocket proxying and dynamic configuration reloading, refer to the network proxy example provided above. The WebSocket support demonstrates how seamless it is to work with real-time applications.
94
+
95
+ Remember, when dealing with certificates and private keys for HTTPS configurations, always secure your keys and store them appropriately.
96
+
97
+ `@push.rocks/smartproxy` provides a solid foundation for handling high workloads and complex proxying requirements with ease, whether you're implementing SSL redirections, port forwarding, or extensive routing and WebSocket support in your network.
98
+
99
+ For more information on how to use the features, refer to the in-depth documentation available in the package's repository or the npm package description.
100
+
101
+ ## License and Legal Information
102
+
103
+ This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
104
+
105
+ **Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
29
106
 
30
- 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). :)
107
+ ### Trademarks
31
108
 
32
- ## Contribution
109
+ This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
33
110
 
34
- 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). :)
111
+ ### Company Information
35
112
 
36
- For further information read the linked docs at the top of this readme.
113
+ Task Venture Capital GmbH
114
+ Registered at District court Bremen HRB 35230 HB, Germany
37
115
 
38
- > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
39
- | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
116
+ For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
40
117
 
41
- [![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
118
+ By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
@@ -1,8 +1,8 @@
1
1
  /**
2
- * autocreated commitinfo by @pushrocks/commitinfo
2
+ * autocreated commitinfo by @push.rocks/commitinfo
3
3
  */
4
4
  export const commitinfo = {
5
- name: '@pushrocks/smartproxy',
6
- version: '3.0.58',
5
+ name: '@push.rocks/smartproxy',
6
+ version: '3.0.61',
7
7
  description: 'a proxy for handling high workloads of proxying'
8
8
  }
package/ts/index.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './smartproxy.classes.networkproxy.js';
2
2
  export * from './smartproxy.portproxy.js';
3
- export * from './smartproxy.classes.sslredirect.js'
3
+ export * from './smartproxy.classes.sslredirect.js';