@push.rocks/smartproxy 30.0.1 → 30.1.0
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.
- package/changelog.md +18 -0
- package/dist_rust/rustproxy_linux_amd64_musl.third-party-notices.json +3358 -0
- package/dist_rust/rustproxy_linux_amd64_musl.third-party-notices.txt +44997 -0
- package/dist_rust/rustproxy_linux_amd64_musl.tsrust-build.json +4 -4
- package/dist_rust/rustproxy_linux_arm64_musl.third-party-notices.json +3358 -0
- package/dist_rust/rustproxy_linux_arm64_musl.third-party-notices.txt +44997 -0
- package/dist_rust/rustproxy_linux_arm64_musl.tsrust-build.json +4 -4
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/proxies/smart-proxy/models/interfaces.d.ts +10 -2
- package/dist_ts/proxies/smart-proxy/models/rust-types.d.ts +4 -2
- package/dist_ts/proxies/smart-proxy/smart-proxy.js +7 -3
- package/dist_ts/proxies/smart-proxy/utils/route-validator.d.ts +4 -3
- package/dist_ts/proxies/smart-proxy/utils/route-validator.js +14 -3
- package/dist_ts/proxies/smart-proxy/utils/rust-config.js +2 -1
- package/native-notices/manifest.json +13 -1
- package/native-notices/readme.md +4 -2
- package/native-notices/runtime/libunwind-22.1.2/license.txt +311 -0
- package/package.json +4 -4
- package/readme.md +3 -3
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/proxies/smart-proxy/models/interfaces.ts +10 -2
- package/ts/proxies/smart-proxy/models/rust-types.ts +4 -2
- package/ts/proxies/smart-proxy/smart-proxy.ts +6 -2
- package/ts/proxies/smart-proxy/utils/route-validator.ts +16 -3
- package/ts/proxies/smart-proxy/utils/rust-config.ts +1 -0
|
@@ -137,6 +137,7 @@ export function buildRustProxyOptions(settings, routes, acmeOverride, challengeO
|
|
|
137
137
|
enableDetailedLogging: settings.enableDetailedLogging,
|
|
138
138
|
enableTlsDebugLogging: settings.enableTlsDebugLogging,
|
|
139
139
|
enableRandomizedTimeouts: settings.enableRandomizedTimeouts,
|
|
140
|
+
// `null` travels as JSON `null`, which the engine reads as `None`: no per-IP limit.
|
|
140
141
|
maxConnectionsPerIp: settings.maxConnectionsPerIP,
|
|
141
142
|
connectionRateLimitPerMinute: settings.connectionRateLimitPerMinute,
|
|
142
143
|
keepAliveTreatment: settings.keepAliveTreatment,
|
|
@@ -148,4 +149,4 @@ export function buildRustProxyOptions(settings, routes, acmeOverride, challengeO
|
|
|
148
149
|
acme: serializeAcmeForRust(acme),
|
|
149
150
|
};
|
|
150
151
|
}
|
|
151
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
152
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicnVzdC1jb25maWcuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi90cy9wcm94aWVzL3NtYXJ0LXByb3h5L3V0aWxzL3J1c3QtY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWdCQSxNQUFNLHFCQUFxQixHQUFHLElBQUksR0FBRyxDQUFDLENBQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQyxDQUFDLENBQUM7QUFFakUsTUFBTSxVQUFVLHlCQUF5QixDQUFDLEtBQXNCO0lBQzlELElBQUksT0FBTyxLQUFLLEtBQUssUUFBUSxFQUFFLENBQUM7UUFDOUIsT0FBTyxLQUFLLENBQUM7SUFDZixDQUFDO0lBRUQsTUFBTSxnQkFBZ0IsR0FBRyxLQUFLLENBQUMsSUFBSSxDQUFDLElBQUksR0FBRyxDQUFDLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDLElBQUksRUFBRSxFQUFFLENBQUMsQ0FBQyxxQkFBcUIsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQztJQUM3RyxJQUFJLGdCQ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[
|
|
180
180
|
"gcc",
|
|
181
|
+
"libunwind-22.1.2",
|
|
181
182
|
"musl-1.2.5"
|
|
182
183
|
]
|
|
183
184
|
},
|
|
@@ -354,6 +355,7 @@
|
|
|
354
355
|
],
|
|
355
356
|
"runtime": [
|
|
356
357
|
"gcc",
|
|
358
|
+
"libunwind-22.1.2",
|
|
357
359
|
"musl-1.2.5"
|
|
358
360
|
]
|
|
359
361
|
}
|
|
@@ -3760,6 +3762,15 @@
|
|
|
3760
3762
|
"runtime/gcc/runtime-library-exception-3.1.txt"
|
|
3761
3763
|
]
|
|
3762
3764
|
},
|
|
3765
|
+
{
|
|
3766
|
+
"id": "libunwind-22.1.2",
|
|
3767
|
+
"name": "libunwind",
|
|
3768
|
+
"version": "22.1.2",
|
|
3769
|
+
"license": "Apache-2.0 WITH LLVM-exception AND (NCSA OR MIT)",
|
|
3770
|
+
"files": [
|
|
3771
|
+
"runtime/libunwind-22.1.2/license.txt"
|
|
3772
|
+
]
|
|
3773
|
+
},
|
|
3763
3774
|
{
|
|
3764
3775
|
"id": "musl-1.2.5",
|
|
3765
3776
|
"name": "musl",
|
|
@@ -4088,9 +4099,10 @@
|
|
|
4088
4099
|
"native/ring-0.17.14/fiat-crypto-ring-0.17.14/license-boringssl": "005fc765ddc5115da796cca915baa9557abae13ff35e0a47c47affc56f6c414d",
|
|
4089
4100
|
"native/ring-0.17.14/fiat-crypto-ring-0.17.14/third_party-fiat-license": "9eacbcb81be660840c714a560a9d65ba07913db98dd4baf969f78dd499fdd60f",
|
|
4090
4101
|
"native/tikv-jemalloc-sys-0.7.1+5.3.1-0-g81034ce1f1373e37dc865038e1bc8eeecf559ce8/jemalloc-5.3.1/jemalloc-copying": "94aa2caa98c25d942f58b956c71dba6a99ff98fc3a31cbc669fe2a4cd0268b53",
|
|
4091
|
-
"readme.md": "
|
|
4102
|
+
"readme.md": "fcd38ebe04cfc135b416cba65b395719d8355d8cd240d799817cd105e1bbfb1b",
|
|
4092
4103
|
"runtime/gcc/gpl-3.0.txt": "8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903",
|
|
4093
4104
|
"runtime/gcc/runtime-library-exception-3.1.txt": "9d6b43ce4d8de0c878bf16b54d8e7a10d9bd42b75178153e3af6a815bdc90f74",
|
|
4105
|
+
"runtime/libunwind-22.1.2/license.txt": "b5efebcaca80879234098e52d1725e6d9eb8fb96a19fce625d39184b705f7b6d",
|
|
4094
4106
|
"runtime/musl-1.2.5/copyright": "f9bc4423732350eb0b3f7ed7e91d530298476f8fec0c6c427a1c04ade22655af",
|
|
4095
4107
|
"rust/compiler-builtins-license.txt": "ab6eec6caf0fa5775e411c7a8bc6a45c4ef2956b0980b157ab74fc5cd62a928b",
|
|
4096
4108
|
"rust/copyright-library.html": "90567e2718bf7fd65a71a3a43c5596488e80e5f51ed02bfea6fec54458b5f3d1",
|
package/native-notices/readme.md
CHANGED
|
@@ -40,8 +40,10 @@ under the GNU General Public License version 3 or later with the GCC Runtime Lib
|
|
|
40
40
|
Exception 3.1 (`runtime/gcc/`). The exception permits distributing the executables under
|
|
41
41
|
the package's own terms.
|
|
42
42
|
|
|
43
|
+
The static musl executables also contain LLVM's libunwind 22.1.2, which the Rust
|
|
44
|
+
standard library links for unwinding, under Apache-2.0 WITH LLVM-exception AND (NCSA OR MIT) (`runtime/libunwind-22.1.2/license.txt`).
|
|
45
|
+
|
|
43
46
|
The static musl executables contain musl 1.2.5, the C library shipped with the Rust
|
|
44
47
|
toolchain, under the MIT license (`runtime/musl-1.2.5/copyright`).
|
|
45
48
|
|
|
46
|
-
The Rust standard library and its runtime
|
|
47
|
-
executables) are covered by `rust/`.
|
|
49
|
+
The Rust standard library and its runtime are covered by `rust/`.
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
==============================================================================
|
|
2
|
+
The LLVM Project is under the Apache License v2.0 with LLVM Exceptions:
|
|
3
|
+
==============================================================================
|
|
4
|
+
|
|
5
|
+
Apache License
|
|
6
|
+
Version 2.0, January 2004
|
|
7
|
+
http://www.apache.org/licenses/
|
|
8
|
+
|
|
9
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
10
|
+
|
|
11
|
+
1. Definitions.
|
|
12
|
+
|
|
13
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
14
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
15
|
+
|
|
16
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
17
|
+
the copyright owner that is granting the License.
|
|
18
|
+
|
|
19
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
20
|
+
other entities that control, are controlled by, or are under common
|
|
21
|
+
control with that entity. For the purposes of this definition,
|
|
22
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
23
|
+
direction or management of such entity, whether by contract or
|
|
24
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
25
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
26
|
+
|
|
27
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
28
|
+
exercising permissions granted by this License.
|
|
29
|
+
|
|
30
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
31
|
+
including but not limited to software source code, documentation
|
|
32
|
+
source, and configuration files.
|
|
33
|
+
|
|
34
|
+
"Object" form shall mean any form resulting from mechanical
|
|
35
|
+
transformation or translation of a Source form, including but
|
|
36
|
+
not limited to compiled object code, generated documentation,
|
|
37
|
+
and conversions to other media types.
|
|
38
|
+
|
|
39
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
40
|
+
Object form, made available under the License, as indicated by a
|
|
41
|
+
copyright notice that is included in or attached to the work
|
|
42
|
+
(an example is provided in the Appendix below).
|
|
43
|
+
|
|
44
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
45
|
+
form, that is based on (or derived from) the Work and for which the
|
|
46
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
47
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
48
|
+
of this License, Derivative Works shall not include works that remain
|
|
49
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
50
|
+
the Work and Derivative Works thereof.
|
|
51
|
+
|
|
52
|
+
"Contribution" shall mean any work of authorship, including
|
|
53
|
+
the original version of the Work and any modifications or additions
|
|
54
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
55
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
56
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
57
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
58
|
+
means any form of electronic, verbal, or written communication sent
|
|
59
|
+
to the Licensor or its representatives, including but not limited to
|
|
60
|
+
communication on electronic mailing lists, source code control systems,
|
|
61
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
62
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
63
|
+
excluding communication that is conspicuously marked or otherwise
|
|
64
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
65
|
+
|
|
66
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
67
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
68
|
+
subsequently incorporated within the Work.
|
|
69
|
+
|
|
70
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
71
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
72
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
73
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
74
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
75
|
+
Work and such Derivative Works in Source or Object form.
|
|
76
|
+
|
|
77
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
78
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
79
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
80
|
+
(except as stated in this section) patent license to make, have made,
|
|
81
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
82
|
+
where such license applies only to those patent claims licensable
|
|
83
|
+
by such Contributor that are necessarily infringed by their
|
|
84
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
85
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
86
|
+
institute patent litigation against any entity (including a
|
|
87
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
88
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
89
|
+
or contributory patent infringement, then any patent licenses
|
|
90
|
+
granted to You under this License for that Work shall terminate
|
|
91
|
+
as of the date such litigation is filed.
|
|
92
|
+
|
|
93
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
94
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
95
|
+
modifications, and in Source or Object form, provided that You
|
|
96
|
+
meet the following conditions:
|
|
97
|
+
|
|
98
|
+
(a) You must give any other recipients of the Work or
|
|
99
|
+
Derivative Works a copy of this License; and
|
|
100
|
+
|
|
101
|
+
(b) You must cause any modified files to carry prominent notices
|
|
102
|
+
stating that You changed the files; and
|
|
103
|
+
|
|
104
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
105
|
+
that You distribute, all copyright, patent, trademark, and
|
|
106
|
+
attribution notices from the Source form of the Work,
|
|
107
|
+
excluding those notices that do not pertain to any part of
|
|
108
|
+
the Derivative Works; and
|
|
109
|
+
|
|
110
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
111
|
+
distribution, then any Derivative Works that You distribute must
|
|
112
|
+
include a readable copy of the attribution notices contained
|
|
113
|
+
within such NOTICE file, excluding those notices that do not
|
|
114
|
+
pertain to any part of the Derivative Works, in at least one
|
|
115
|
+
of the following places: within a NOTICE text file distributed
|
|
116
|
+
as part of the Derivative Works; within the Source form or
|
|
117
|
+
documentation, if provided along with the Derivative Works; or,
|
|
118
|
+
within a display generated by the Derivative Works, if and
|
|
119
|
+
wherever such third-party notices normally appear. The contents
|
|
120
|
+
of the NOTICE file are for informational purposes only and
|
|
121
|
+
do not modify the License. You may add Your own attribution
|
|
122
|
+
notices within Derivative Works that You distribute, alongside
|
|
123
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
124
|
+
that such additional attribution notices cannot be construed
|
|
125
|
+
as modifying the License.
|
|
126
|
+
|
|
127
|
+
You may add Your own copyright statement to Your modifications and
|
|
128
|
+
may provide additional or different license terms and conditions
|
|
129
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
130
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
131
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
132
|
+
the conditions stated in this License.
|
|
133
|
+
|
|
134
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
135
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
136
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
137
|
+
this License, without any additional terms or conditions.
|
|
138
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
139
|
+
the terms of any separate license agreement you may have executed
|
|
140
|
+
with Licensor regarding such Contributions.
|
|
141
|
+
|
|
142
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
143
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
144
|
+
except as required for reasonable and customary use in describing the
|
|
145
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
146
|
+
|
|
147
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
148
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
149
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
150
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
151
|
+
implied, including, without limitation, any warranties or conditions
|
|
152
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
153
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
154
|
+
appropriateness of using or redistributing the Work and assume any
|
|
155
|
+
risks associated with Your exercise of permissions under this License.
|
|
156
|
+
|
|
157
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
158
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
159
|
+
unless required by applicable law (such as deliberate and grossly
|
|
160
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
161
|
+
liable to You for damages, including any direct, indirect, special,
|
|
162
|
+
incidental, or consequential damages of any character arising as a
|
|
163
|
+
result of this License or out of the use or inability to use the
|
|
164
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
165
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
166
|
+
other commercial damages or losses), even if such Contributor
|
|
167
|
+
has been advised of the possibility of such damages.
|
|
168
|
+
|
|
169
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
170
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
171
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
172
|
+
or other liability obligations and/or rights consistent with this
|
|
173
|
+
License. However, in accepting such obligations, You may act only
|
|
174
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
175
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
176
|
+
defend, and hold each Contributor harmless for any liability
|
|
177
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
178
|
+
of your accepting any such warranty or additional liability.
|
|
179
|
+
|
|
180
|
+
END OF TERMS AND CONDITIONS
|
|
181
|
+
|
|
182
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
183
|
+
|
|
184
|
+
To apply the Apache License to your work, attach the following
|
|
185
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
186
|
+
replaced with your own identifying information. (Don't include
|
|
187
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
188
|
+
comment syntax for the file format. We also recommend that a
|
|
189
|
+
file or class name and description of purpose be included on the
|
|
190
|
+
same "printed page" as the copyright notice for easier
|
|
191
|
+
identification within third-party archives.
|
|
192
|
+
|
|
193
|
+
Copyright [yyyy] [name of copyright owner]
|
|
194
|
+
|
|
195
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
196
|
+
you may not use this file except in compliance with the License.
|
|
197
|
+
You may obtain a copy of the License at
|
|
198
|
+
|
|
199
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
200
|
+
|
|
201
|
+
Unless required by applicable law or agreed to in writing, software
|
|
202
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
203
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
204
|
+
See the License for the specific language governing permissions and
|
|
205
|
+
limitations under the License.
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
---- LLVM Exceptions to the Apache 2.0 License ----
|
|
209
|
+
|
|
210
|
+
As an exception, if, as a result of your compiling your source code, portions
|
|
211
|
+
of this Software are embedded into an Object form of such source code, you
|
|
212
|
+
may redistribute such embedded portions in such Object form without complying
|
|
213
|
+
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
|
|
214
|
+
|
|
215
|
+
In addition, if you combine or link compiled forms of this Software with
|
|
216
|
+
software that is licensed under the GPLv2 ("Combined Software") and if a
|
|
217
|
+
court of competent jurisdiction determines that the patent provision (Section
|
|
218
|
+
3), the indemnity provision (Section 9) or other Section of the License
|
|
219
|
+
conflicts with the conditions of the GPLv2, you may retroactively and
|
|
220
|
+
prospectively choose to deem waived or otherwise exclude such Section(s) of
|
|
221
|
+
the License, but only in their entirety and only with respect to the Combined
|
|
222
|
+
Software.
|
|
223
|
+
|
|
224
|
+
==============================================================================
|
|
225
|
+
Software from third parties included in the LLVM Project:
|
|
226
|
+
==============================================================================
|
|
227
|
+
The LLVM Project contains third party software which is under different license
|
|
228
|
+
terms. All such code will be identified clearly using at least one of two
|
|
229
|
+
mechanisms:
|
|
230
|
+
1) It will be in a separate directory tree with its own `LICENSE.txt` or
|
|
231
|
+
`LICENSE` file at the top containing the specific license and restrictions
|
|
232
|
+
which apply to that software, or
|
|
233
|
+
2) It will contain specific license and restriction terms at the top of every
|
|
234
|
+
file.
|
|
235
|
+
|
|
236
|
+
==============================================================================
|
|
237
|
+
Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy):
|
|
238
|
+
==============================================================================
|
|
239
|
+
|
|
240
|
+
The libunwind library is dual licensed under both the University of Illinois
|
|
241
|
+
"BSD-Like" license and the MIT license. As a user of this code you may choose
|
|
242
|
+
to use it under either license. As a contributor, you agree to allow your code
|
|
243
|
+
to be used under both.
|
|
244
|
+
|
|
245
|
+
Full text of the relevant licenses is included below.
|
|
246
|
+
|
|
247
|
+
==============================================================================
|
|
248
|
+
|
|
249
|
+
University of Illinois/NCSA
|
|
250
|
+
Open Source License
|
|
251
|
+
|
|
252
|
+
Copyright (c) 2009-2019 by the contributors listed in CREDITS.TXT
|
|
253
|
+
|
|
254
|
+
All rights reserved.
|
|
255
|
+
|
|
256
|
+
Developed by:
|
|
257
|
+
|
|
258
|
+
LLVM Team
|
|
259
|
+
|
|
260
|
+
University of Illinois at Urbana-Champaign
|
|
261
|
+
|
|
262
|
+
http://llvm.org
|
|
263
|
+
|
|
264
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
265
|
+
this software and associated documentation files (the "Software"), to deal with
|
|
266
|
+
the Software without restriction, including without limitation the rights to
|
|
267
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
268
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
269
|
+
so, subject to the following conditions:
|
|
270
|
+
|
|
271
|
+
* Redistributions of source code must retain the above copyright notice,
|
|
272
|
+
this list of conditions and the following disclaimers.
|
|
273
|
+
|
|
274
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
275
|
+
this list of conditions and the following disclaimers in the
|
|
276
|
+
documentation and/or other materials provided with the distribution.
|
|
277
|
+
|
|
278
|
+
* Neither the names of the LLVM Team, University of Illinois at
|
|
279
|
+
Urbana-Champaign, nor the names of its contributors may be used to
|
|
280
|
+
endorse or promote products derived from this Software without specific
|
|
281
|
+
prior written permission.
|
|
282
|
+
|
|
283
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
284
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
285
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
286
|
+
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
287
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
288
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
|
|
289
|
+
SOFTWARE.
|
|
290
|
+
|
|
291
|
+
==============================================================================
|
|
292
|
+
|
|
293
|
+
Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT
|
|
294
|
+
|
|
295
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
296
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
297
|
+
in the Software without restriction, including without limitation the rights
|
|
298
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
299
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
300
|
+
furnished to do so, subject to the following conditions:
|
|
301
|
+
|
|
302
|
+
The above copyright notice and this permission notice shall be included in
|
|
303
|
+
all copies or substantial portions of the Software.
|
|
304
|
+
|
|
305
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
306
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
307
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
308
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
309
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
310
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
311
|
+
THE SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@push.rocks/smartproxy",
|
|
3
|
-
"version": "30.0
|
|
3
|
+
"version": "30.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.",
|
|
6
6
|
"main": "dist_ts/index.js",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@git.zone/tsbuild": "^6.0.2",
|
|
13
13
|
"@git.zone/tsrun": "^3.0.3",
|
|
14
|
-
"@git.zone/tsrust": "^
|
|
15
|
-
"@git.zone/tstest": "^
|
|
14
|
+
"@git.zone/tsrust": "^5.0.0",
|
|
15
|
+
"@git.zone/tstest": "^8.0.0",
|
|
16
16
|
"@push.rocks/smartserve": "^2.0.4",
|
|
17
|
-
"@types/node": "^26.6.
|
|
17
|
+
"@types/node": "^26.6.5",
|
|
18
18
|
"@types/ws": "^8.18.1",
|
|
19
19
|
"typescript": "^6.0.3",
|
|
20
20
|
"why-is-node-running": "^3.2.2",
|
package/readme.md
CHANGED
|
@@ -1198,8 +1198,8 @@ interface ISmartProxyOptions {
|
|
|
1198
1198
|
gracefulShutdownTimeout?: number; // Shutdown grace period (default: 30s)
|
|
1199
1199
|
|
|
1200
1200
|
// Connection limits
|
|
1201
|
-
maxConnectionsPerIP?: number;
|
|
1202
|
-
connectionRateLimitPerMinute?: number;
|
|
1201
|
+
maxConnectionsPerIP?: number | null; // Per-IP simultaneous connections (default: 100; null: no limit)
|
|
1202
|
+
connectionRateLimitPerMinute?: number | null; // Per-IP new connections per minute (default: 300; null: no limit)
|
|
1203
1203
|
securityPolicy?: {
|
|
1204
1204
|
blockedIps?: string[];
|
|
1205
1205
|
blockedCidrs?: string[];
|
|
@@ -1373,7 +1373,7 @@ SmartProxy searches for the Rust binary in this order:
|
|
|
1373
1373
|
- ✅ Use NFTables forwarding for high-traffic routes (Linux only)
|
|
1374
1374
|
- ✅ Enable connection keep-alive where appropriate
|
|
1375
1375
|
- ✅ Use `getMetrics()` and `getStatistics()` to identify bottlenecks
|
|
1376
|
-
- ✅ Adjust `maxConnectionsPerIP` and `connectionRateLimitPerMinute` based on your workload
|
|
1376
|
+
- ✅ Adjust `maxConnectionsPerIP` and `connectionRateLimitPerMinute` based on your workload. Both count connections per source IP as the listener sees it, before the SNI or any request is read. Behind a reverse proxy that does not send PROXY protocol (such as an HTTP hop that pools its backend connections), every client arrives from the proxy's address and shares one budget; set the limits to `null` there to turn them off and enforce them at the edge that sees the real clients. Omitting a limit keeps its default; `0`, negative and non-integer values are refused, `0` never read as "no limit".
|
|
1377
1377
|
- ✅ Use `passthrough` TLS mode when backend can handle TLS directly
|
|
1378
1378
|
|
|
1379
1379
|
## 🏆 Best Practices
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartproxy',
|
|
6
|
-
version: '30.0
|
|
6
|
+
version: '30.1.0',
|
|
7
7
|
description: 'A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.'
|
|
8
8
|
}
|
|
@@ -199,8 +199,16 @@ export interface ISmartProxyOptions {
|
|
|
199
199
|
enableRandomizedTimeouts?: boolean; // Randomize timeouts slightly to prevent thundering herd
|
|
200
200
|
|
|
201
201
|
// Rate limiting and security
|
|
202
|
-
|
|
203
|
-
|
|
202
|
+
/**
|
|
203
|
+
* Maximum simultaneous connections from a single source IP. Omitted: 100. `null`: no per-IP
|
|
204
|
+
* limit. Must be a positive integer otherwise; 0 and negative values are refused.
|
|
205
|
+
*/
|
|
206
|
+
maxConnectionsPerIP?: number | null;
|
|
207
|
+
/**
|
|
208
|
+
* Maximum new connections per minute from a single source IP. Omitted: 300. `null`: no per-IP
|
|
209
|
+
* rate limit. Must be a positive integer otherwise; 0 and negative values are refused.
|
|
210
|
+
*/
|
|
211
|
+
connectionRateLimitPerMinute?: number | null;
|
|
204
212
|
securityPolicy?: ISmartProxySecurityPolicy; // Global ingress block policy, enforced before routing
|
|
205
213
|
|
|
206
214
|
/** Runtime-only challenge enforcement settings. Never store this in route configs. */
|
|
@@ -93,8 +93,10 @@ export interface IRustProxyOptions {
|
|
|
93
93
|
enableDetailedLogging?: boolean;
|
|
94
94
|
enableTlsDebugLogging?: boolean;
|
|
95
95
|
enableRandomizedTimeouts?: boolean;
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
/** `null`: no per-IP limit (the engine's `None`). */
|
|
97
|
+
maxConnectionsPerIp?: number | null;
|
|
98
|
+
/** `null`: no per-IP rate limit (the engine's `None`). */
|
|
99
|
+
connectionRateLimitPerMinute?: number | null;
|
|
98
100
|
keepAliveTreatment?: ISmartProxyOptions['keepAliveTreatment'];
|
|
99
101
|
keepAliveInactivityMultiplier?: number;
|
|
100
102
|
extendedKeepAliveLifetime?: number;
|
|
@@ -77,8 +77,12 @@ export class SmartProxy extends plugins.EventEmitter {
|
|
|
77
77
|
maxConnectionLifetime: settingsArg.maxConnectionLifetime || 3_600_000,
|
|
78
78
|
inactivityTimeout: settingsArg.inactivityTimeout || 75_000,
|
|
79
79
|
gracefulShutdownTimeout: settingsArg.gracefulShutdownTimeout || 30_000,
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
// Only an omitted value takes the default: `null` means no per-IP limit (so neither `||`
|
|
81
|
+
// nor `??` fits), and 0 or a negative value is refused by the settings validation below.
|
|
82
|
+
maxConnectionsPerIP: settingsArg.maxConnectionsPerIP === undefined ? 100 : settingsArg.maxConnectionsPerIP,
|
|
83
|
+
connectionRateLimitPerMinute: settingsArg.connectionRateLimitPerMinute === undefined
|
|
84
|
+
? 300
|
|
85
|
+
: settingsArg.connectionRateLimitPerMinute,
|
|
82
86
|
keepAliveTreatment: settingsArg.keepAliveTreatment || 'standard',
|
|
83
87
|
keepAliveInactivityMultiplier: settingsArg.keepAliveInactivityMultiplier || 4,
|
|
84
88
|
extendedKeepAliveLifetime: settingsArg.extendedKeepAliveLifetime || 3_600_000,
|
|
@@ -363,14 +363,27 @@ export class RouteValidator {
|
|
|
363
363
|
}
|
|
364
364
|
|
|
365
365
|
/**
|
|
366
|
-
* Validate the
|
|
366
|
+
* Validate the settings outside routes: the IP entries of the global `trustedProxyIPs`, the
|
|
367
367
|
* `defaults.security` lists the engine copies into routes without security, and the global
|
|
368
|
-
* `securityPolicy
|
|
368
|
+
* `securityPolicy`; and the per-IP limits `maxConnectionsPerIP` and `connectionRateLimitPerMinute`.
|
|
369
|
+
* Answers every reason, empty when the settings are valid.
|
|
369
370
|
*/
|
|
370
371
|
public static validateSettings(
|
|
371
|
-
settings: Pick<
|
|
372
|
+
settings: Pick<
|
|
373
|
+
ISmartProxyOptions,
|
|
374
|
+
'trustedProxyIPs' | 'defaults' | 'securityPolicy' | 'maxConnectionsPerIP' | 'connectionRateLimitPerMinute'
|
|
375
|
+
>,
|
|
372
376
|
): string[] {
|
|
373
377
|
const errors: string[] = [];
|
|
378
|
+
// A per-IP limit is a positive integer, or `null` for no limit. 0 is refused rather than read
|
|
379
|
+
// as "no limit": it would otherwise silently mean the opposite of what it says.
|
|
380
|
+
for (const field of ['maxConnectionsPerIP', 'connectionRateLimitPerMinute'] as const) {
|
|
381
|
+
const value: unknown = settings[field];
|
|
382
|
+
if (value === undefined || value === null) continue;
|
|
383
|
+
if (typeof value !== 'number' || !Number.isSafeInteger(value) || value <= 0) {
|
|
384
|
+
errors.push(`${field} must be a positive integer, or null for no per-IP limit (got ${String(value)})`);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
374
387
|
const checkList = (
|
|
375
388
|
list: unknown,
|
|
376
389
|
field: string,
|
|
@@ -198,6 +198,7 @@ export function buildRustProxyOptions(
|
|
|
198
198
|
enableDetailedLogging: settings.enableDetailedLogging,
|
|
199
199
|
enableTlsDebugLogging: settings.enableTlsDebugLogging,
|
|
200
200
|
enableRandomizedTimeouts: settings.enableRandomizedTimeouts,
|
|
201
|
+
// `null` travels as JSON `null`, which the engine reads as `None`: no per-IP limit.
|
|
201
202
|
maxConnectionsPerIp: settings.maxConnectionsPerIP,
|
|
202
203
|
connectionRateLimitPerMinute: settings.connectionRateLimitPerMinute,
|
|
203
204
|
keepAliveTreatment: settings.keepAliveTreatment,
|