@push.rocks/smartproxy 12.0.0 → 13.1.3
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/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/certificate/acme/acme-factory.d.ts +17 -0
- package/dist_ts/certificate/acme/acme-factory.js +40 -0
- package/dist_ts/certificate/acme/challenge-handler.d.ts +44 -0
- package/dist_ts/certificate/acme/challenge-handler.js +92 -0
- package/dist_ts/certificate/acme/index.d.ts +4 -0
- package/dist_ts/certificate/acme/index.js +5 -0
- package/dist_ts/certificate/events/certificate-events.d.ts +33 -0
- package/dist_ts/certificate/events/certificate-events.js +38 -0
- package/dist_ts/certificate/index.d.ts +24 -0
- package/dist_ts/certificate/index.js +39 -0
- package/dist_ts/certificate/models/certificate-types.d.ts +77 -0
- package/dist_ts/certificate/models/certificate-types.js +2 -0
- package/dist_ts/certificate/providers/cert-provisioner.d.ts +93 -0
- package/dist_ts/certificate/providers/cert-provisioner.js +262 -0
- package/dist_ts/certificate/providers/index.d.ts +4 -0
- package/dist_ts/certificate/providers/index.js +5 -0
- package/dist_ts/certificate/storage/file-storage.d.ts +66 -0
- package/dist_ts/certificate/storage/file-storage.js +194 -0
- package/dist_ts/certificate/storage/index.d.ts +4 -0
- package/dist_ts/certificate/storage/index.js +5 -0
- package/dist_ts/certificate/utils/certificate-helpers.d.ts +17 -0
- package/dist_ts/certificate/utils/certificate-helpers.js +45 -0
- package/dist_ts/common/eventUtils.d.ts +1 -1
- package/dist_ts/common/port80-adapter.d.ts +1 -1
- package/dist_ts/core/events/index.d.ts +4 -0
- package/dist_ts/core/events/index.js +5 -0
- package/dist_ts/core/index.d.ts +6 -0
- package/dist_ts/core/index.js +8 -0
- package/dist_ts/core/models/common-types.d.ts +82 -0
- package/dist_ts/core/models/common-types.js +15 -0
- package/dist_ts/core/models/index.d.ts +4 -0
- package/dist_ts/core/models/index.js +5 -0
- package/dist_ts/core/utils/event-utils.d.ts +15 -0
- package/dist_ts/core/utils/event-utils.js +19 -0
- package/dist_ts/core/utils/index.d.ts +6 -0
- package/dist_ts/core/utils/index.js +7 -0
- package/dist_ts/core/utils/ip-utils.d.ts +53 -0
- package/dist_ts/core/utils/ip-utils.js +153 -0
- package/dist_ts/core/utils/validation-utils.d.ts +61 -0
- package/dist_ts/core/utils/validation-utils.js +149 -0
- package/dist_ts/forwarding/config/domain-config.d.ts +12 -0
- package/dist_ts/forwarding/config/domain-config.js +12 -0
- package/dist_ts/forwarding/config/domain-manager.d.ts +86 -0
- package/dist_ts/forwarding/config/domain-manager.js +242 -0
- package/dist_ts/forwarding/config/forwarding-types.d.ts +104 -0
- package/dist_ts/forwarding/config/forwarding-types.js +50 -0
- package/dist_ts/forwarding/config/index.d.ts +6 -0
- package/dist_ts/forwarding/config/index.js +7 -0
- package/dist_ts/forwarding/factory/forwarding-factory.d.ts +25 -0
- package/dist_ts/forwarding/factory/forwarding-factory.js +138 -0
- package/dist_ts/forwarding/factory/index.d.ts +4 -0
- package/dist_ts/forwarding/factory/index.js +5 -0
- package/dist_ts/forwarding/handlers/base-handler.d.ts +55 -0
- package/dist_ts/forwarding/handlers/base-handler.js +94 -0
- package/dist_ts/forwarding/handlers/http-handler.d.ts +30 -0
- package/dist_ts/forwarding/handlers/http-handler.js +131 -0
- package/dist_ts/forwarding/handlers/https-passthrough-handler.d.ts +29 -0
- package/dist_ts/forwarding/handlers/https-passthrough-handler.js +162 -0
- package/dist_ts/forwarding/handlers/https-terminate-to-http-handler.d.ts +36 -0
- package/dist_ts/forwarding/handlers/https-terminate-to-http-handler.js +229 -0
- package/dist_ts/forwarding/handlers/https-terminate-to-https-handler.d.ts +35 -0
- package/dist_ts/forwarding/handlers/https-terminate-to-https-handler.js +254 -0
- package/dist_ts/forwarding/handlers/index.d.ts +8 -0
- package/dist_ts/forwarding/handlers/index.js +9 -0
- package/dist_ts/forwarding/index.d.ts +19 -0
- package/dist_ts/forwarding/index.js +25 -0
- package/dist_ts/http/index.d.ts +15 -0
- package/dist_ts/http/index.js +20 -0
- package/dist_ts/http/models/http-types.d.ts +81 -0
- package/dist_ts/http/models/http-types.js +62 -0
- package/dist_ts/http/port80/acme-interfaces.d.ts +78 -0
- package/dist_ts/http/port80/acme-interfaces.js +6 -0
- package/dist_ts/http/port80/challenge-responder.d.ts +53 -0
- package/dist_ts/http/port80/challenge-responder.js +203 -0
- package/dist_ts/http/port80/index.d.ts +6 -0
- package/dist_ts/http/port80/index.js +9 -0
- package/dist_ts/http/port80/port80-handler.d.ts +121 -0
- package/dist_ts/http/port80/port80-handler.js +554 -0
- package/dist_ts/http/redirects/index.d.ts +4 -0
- package/dist_ts/http/redirects/index.js +5 -0
- package/dist_ts/http/router/index.d.ts +4 -0
- package/dist_ts/http/router/index.js +5 -0
- package/dist_ts/http/router/proxy-router.d.ts +115 -0
- package/dist_ts/http/router/proxy-router.js +325 -0
- package/dist_ts/index.d.ts +15 -8
- package/dist_ts/index.js +26 -10
- package/dist_ts/networkproxy/classes.np.certificatemanager.js +2 -2
- package/dist_ts/networkproxy/index.d.ts +1 -6
- package/dist_ts/networkproxy/index.js +4 -8
- package/dist_ts/plugins.d.ts +2 -1
- package/dist_ts/plugins.js +3 -2
- package/dist_ts/port80handler/classes.port80handler.d.ts +8 -136
- package/dist_ts/port80handler/classes.port80handler.js +14 -567
- package/dist_ts/proxies/index.d.ts +6 -0
- package/dist_ts/proxies/index.js +8 -0
- package/dist_ts/proxies/network-proxy/certificate-manager.d.ts +77 -0
- package/dist_ts/proxies/network-proxy/certificate-manager.js +373 -0
- package/dist_ts/proxies/network-proxy/connection-pool.d.ts +47 -0
- package/dist_ts/proxies/network-proxy/connection-pool.js +210 -0
- package/dist_ts/proxies/network-proxy/index.d.ts +10 -0
- package/dist_ts/proxies/network-proxy/index.js +12 -0
- package/dist_ts/proxies/network-proxy/models/index.d.ts +4 -0
- package/dist_ts/proxies/network-proxy/models/index.js +5 -0
- package/dist_ts/proxies/network-proxy/models/types.d.ts +80 -0
- package/dist_ts/proxies/network-proxy/models/types.js +35 -0
- package/dist_ts/proxies/network-proxy/network-proxy.d.ts +118 -0
- package/dist_ts/proxies/network-proxy/network-proxy.js +387 -0
- package/dist_ts/proxies/network-proxy/request-handler.d.ts +57 -0
- package/dist_ts/proxies/network-proxy/request-handler.js +394 -0
- package/dist_ts/proxies/network-proxy/websocket-handler.d.ts +38 -0
- package/dist_ts/proxies/network-proxy/websocket-handler.js +188 -0
- package/dist_ts/proxies/nftables-proxy/index.d.ts +5 -0
- package/dist_ts/proxies/nftables-proxy/index.js +6 -0
- package/dist_ts/proxies/nftables-proxy/models/errors.d.ts +15 -0
- package/dist_ts/proxies/nftables-proxy/models/errors.js +28 -0
- package/dist_ts/proxies/nftables-proxy/models/index.d.ts +5 -0
- package/dist_ts/proxies/nftables-proxy/models/index.js +6 -0
- package/dist_ts/proxies/nftables-proxy/models/interfaces.d.ts +75 -0
- package/dist_ts/proxies/nftables-proxy/models/interfaces.js +5 -0
- package/dist_ts/proxies/nftables-proxy/nftables-proxy.d.ts +136 -0
- package/dist_ts/proxies/nftables-proxy/nftables-proxy.js +1516 -0
- package/dist_ts/proxies/smart-proxy/connection-handler.d.ts +39 -0
- package/dist_ts/proxies/smart-proxy/connection-handler.js +894 -0
- package/dist_ts/proxies/smart-proxy/connection-manager.d.ts +78 -0
- package/dist_ts/proxies/smart-proxy/connection-manager.js +378 -0
- package/dist_ts/proxies/smart-proxy/domain-config-manager.d.ts +95 -0
- package/dist_ts/proxies/smart-proxy/domain-config-manager.js +255 -0
- package/dist_ts/proxies/smart-proxy/index.d.ts +13 -0
- package/dist_ts/proxies/smart-proxy/index.js +17 -0
- package/dist_ts/proxies/smart-proxy/models/index.d.ts +4 -0
- package/dist_ts/proxies/smart-proxy/models/index.js +5 -0
- package/dist_ts/proxies/smart-proxy/models/interfaces.d.ts +107 -0
- package/dist_ts/proxies/smart-proxy/models/interfaces.js +2 -0
- package/dist_ts/proxies/smart-proxy/network-proxy-bridge.d.ts +62 -0
- package/dist_ts/proxies/smart-proxy/network-proxy-bridge.js +316 -0
- package/dist_ts/proxies/smart-proxy/port-range-manager.d.ts +56 -0
- package/dist_ts/proxies/smart-proxy/port-range-manager.js +176 -0
- package/dist_ts/proxies/smart-proxy/security-manager.d.ts +64 -0
- package/dist_ts/proxies/smart-proxy/security-manager.js +149 -0
- package/dist_ts/proxies/smart-proxy/smart-proxy.d.ts +63 -0
- package/dist_ts/proxies/smart-proxy/smart-proxy.js +523 -0
- package/dist_ts/proxies/smart-proxy/timeout-manager.d.ts +47 -0
- package/dist_ts/proxies/smart-proxy/timeout-manager.js +154 -0
- package/dist_ts/proxies/smart-proxy/tls-manager.d.ts +57 -0
- package/dist_ts/proxies/smart-proxy/tls-manager.js +132 -0
- package/dist_ts/smartproxy/classes.pp.networkproxybridge.d.ts +2 -2
- package/dist_ts/smartproxy/classes.pp.networkproxybridge.js +1 -1
- package/dist_ts/smartproxy/classes.pp.tlsmanager.js +2 -2
- package/dist_ts/smartproxy/classes.smartproxy.js +3 -3
- package/dist_ts/tls/alerts/index.d.ts +4 -0
- package/dist_ts/tls/alerts/index.js +5 -0
- package/dist_ts/tls/alerts/tls-alert.d.ts +150 -0
- package/dist_ts/tls/alerts/tls-alert.js +226 -0
- package/dist_ts/tls/index.d.ts +18 -0
- package/dist_ts/tls/index.js +27 -0
- package/dist_ts/tls/sni/client-hello-parser.d.ts +100 -0
- package/dist_ts/tls/sni/client-hello-parser.js +463 -0
- package/dist_ts/tls/sni/index.d.ts +4 -0
- package/dist_ts/tls/sni/index.js +5 -0
- package/dist_ts/tls/sni/sni-extraction.d.ts +58 -0
- package/dist_ts/tls/sni/sni-extraction.js +275 -0
- package/dist_ts/tls/sni/sni-handler.d.ts +154 -0
- package/dist_ts/tls/sni/sni-handler.js +191 -0
- package/dist_ts/tls/utils/index.d.ts +4 -0
- package/dist_ts/tls/utils/index.js +5 -0
- package/dist_ts/tls/utils/tls-utils.d.ts +158 -0
- package/dist_ts/tls/utils/tls-utils.js +187 -0
- package/package.json +1 -1
- package/readme.md +499 -220
- package/readme.plan.md +253 -469
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/certificate/acme/acme-factory.ts +48 -0
- package/ts/certificate/acme/challenge-handler.ts +110 -0
- package/ts/certificate/acme/index.ts +3 -0
- package/ts/certificate/events/certificate-events.ts +36 -0
- package/ts/certificate/index.ts +67 -0
- package/ts/certificate/models/certificate-types.ts +88 -0
- package/ts/certificate/providers/cert-provisioner.ts +326 -0
- package/ts/certificate/providers/index.ts +3 -0
- package/ts/certificate/storage/file-storage.ts +234 -0
- package/ts/certificate/storage/index.ts +3 -0
- package/ts/certificate/utils/certificate-helpers.ts +50 -0
- package/ts/common/eventUtils.ts +1 -1
- package/ts/common/port80-adapter.ts +1 -1
- package/ts/core/events/index.ts +3 -0
- package/ts/core/index.ts +8 -0
- package/ts/core/models/common-types.ts +91 -0
- package/ts/core/models/index.ts +5 -0
- package/ts/core/utils/event-utils.ts +34 -0
- package/ts/core/utils/index.ts +7 -0
- package/ts/core/utils/ip-utils.ts +175 -0
- package/ts/core/utils/validation-utils.ts +177 -0
- package/ts/{smartproxy/forwarding → forwarding/config}/domain-config.ts +1 -1
- package/ts/{smartproxy/forwarding → forwarding/config}/domain-manager.ts +8 -8
- package/ts/{smartproxy/types/forwarding.types.ts → forwarding/config/forwarding-types.ts} +6 -6
- package/ts/forwarding/config/index.ts +7 -0
- package/ts/{smartproxy/forwarding/forwarding.factory.ts → forwarding/factory/forwarding-factory.ts} +12 -11
- package/ts/forwarding/factory/index.ts +5 -0
- package/ts/{smartproxy/forwarding/forwarding.handler.ts → forwarding/handlers/base-handler.ts} +2 -2
- package/ts/{smartproxy/forwarding/http.handler.ts → forwarding/handlers/http-handler.ts} +13 -4
- package/ts/{smartproxy/forwarding/https-passthrough.handler.ts → forwarding/handlers/https-passthrough-handler.ts} +13 -4
- package/ts/{smartproxy/forwarding/https-terminate-to-http.handler.ts → forwarding/handlers/https-terminate-to-http-handler.ts} +3 -3
- package/ts/{smartproxy/forwarding/https-terminate-to-https.handler.ts → forwarding/handlers/https-terminate-to-https-handler.ts} +3 -3
- package/ts/forwarding/handlers/index.ts +9 -0
- package/ts/forwarding/index.ts +34 -0
- package/ts/http/index.ts +23 -0
- package/ts/http/models/http-types.ts +105 -0
- package/ts/http/port80/acme-interfaces.ts +85 -0
- package/ts/http/port80/challenge-responder.ts +246 -0
- package/ts/http/port80/index.ts +13 -0
- package/ts/{port80handler/classes.port80handler.ts → http/port80/port80-handler.ts} +164 -161
- package/ts/http/redirects/index.ts +3 -0
- package/ts/http/router/index.ts +5 -0
- package/ts/{classes.router.ts → http/router/proxy-router.ts} +27 -20
- package/ts/index.ts +32 -9
- package/ts/plugins.ts +2 -1
- package/ts/proxies/index.ts +8 -0
- package/ts/{networkproxy/classes.np.certificatemanager.ts → proxies/network-proxy/certificate-manager.ts} +17 -16
- package/ts/{networkproxy/classes.np.connectionpool.ts → proxies/network-proxy/connection-pool.ts} +3 -3
- package/ts/proxies/network-proxy/index.ts +13 -0
- package/ts/proxies/network-proxy/models/index.ts +4 -0
- package/ts/{networkproxy/classes.np.types.ts → proxies/network-proxy/models/types.ts} +7 -11
- package/ts/{networkproxy/classes.np.networkproxy.ts → proxies/network-proxy/network-proxy.ts} +31 -24
- package/ts/{networkproxy/classes.np.requesthandler.ts → proxies/network-proxy/request-handler.ts} +12 -7
- package/ts/{networkproxy/classes.np.websockethandler.ts → proxies/network-proxy/websocket-handler.ts} +6 -6
- package/ts/proxies/nftables-proxy/index.ts +5 -0
- package/ts/proxies/nftables-proxy/models/errors.ts +30 -0
- package/ts/proxies/nftables-proxy/models/index.ts +5 -0
- package/ts/proxies/nftables-proxy/models/interfaces.ts +94 -0
- package/ts/{nfttablesproxy/classes.nftablesproxy.ts → proxies/nftables-proxy/nftables-proxy.ts} +24 -126
- package/ts/{smartproxy/classes.pp.connectionhandler.ts → proxies/smart-proxy/connection-handler.ts} +12 -12
- package/ts/{smartproxy/classes.pp.connectionmanager.ts → proxies/smart-proxy/connection-manager.ts} +8 -8
- package/ts/{smartproxy/classes.pp.domainconfigmanager.ts → proxies/smart-proxy/domain-config-manager.ts} +15 -14
- package/ts/proxies/smart-proxy/index.ts +18 -0
- package/ts/proxies/smart-proxy/models/index.ts +4 -0
- package/ts/{smartproxy/classes.pp.interfaces.ts → proxies/smart-proxy/models/interfaces.ts} +12 -8
- package/ts/{smartproxy/classes.pp.networkproxybridge.ts → proxies/smart-proxy/network-proxy-bridge.ts} +14 -14
- package/ts/{smartproxy/classes.pp.portrangemanager.ts → proxies/smart-proxy/port-range-manager.ts} +1 -1
- package/ts/{smartproxy/classes.pp.securitymanager.ts → proxies/smart-proxy/security-manager.ts} +3 -3
- package/ts/{smartproxy/classes.smartproxy.ts → proxies/smart-proxy/smart-proxy.ts} +29 -24
- package/ts/{smartproxy/classes.pp.timeoutmanager.ts → proxies/smart-proxy/timeout-manager.ts} +3 -3
- package/ts/{smartproxy/classes.pp.tlsmanager.ts → proxies/smart-proxy/tls-manager.ts} +3 -3
- package/ts/tls/alerts/index.ts +3 -0
- package/ts/{smartproxy/classes.pp.tlsalert.ts → tls/alerts/tls-alert.ts} +44 -43
- package/ts/tls/index.ts +33 -0
- package/ts/tls/sni/client-hello-parser.ts +629 -0
- package/ts/tls/sni/index.ts +3 -0
- package/ts/tls/sni/sni-extraction.ts +353 -0
- package/ts/tls/sni/sni-handler.ts +264 -0
- package/ts/tls/utils/index.ts +3 -0
- package/ts/tls/utils/tls-utils.ts +201 -0
- package/ts/common/acmeFactory.ts +0 -23
- package/ts/helpers.certificates.ts +0 -30
- package/ts/networkproxy/index.ts +0 -7
- package/ts/smartproxy/classes.pp.certprovisioner.ts +0 -200
- package/ts/smartproxy/classes.pp.snihandler.ts +0 -1281
- package/ts/smartproxy/forwarding/index.ts +0 -52
package/readme.plan.md
CHANGED
|
@@ -1,471 +1,255 @@
|
|
|
1
|
-
# SmartProxy
|
|
1
|
+
# SmartProxy Interface & Type Naming Standardization Plan
|
|
2
2
|
|
|
3
3
|
## Project Goal
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- [ ]
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
- [ ]
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
// Pass original client info to backend
|
|
257
|
-
headers: {
|
|
258
|
-
'X-Original-SNI': '{sni}',
|
|
259
|
-
'X-Client-IP': '{clientIp}'
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
## Implementation Plan
|
|
267
|
-
|
|
268
|
-
### Task 1: Core Types and Interfaces (Week 1)
|
|
269
|
-
- [ ] Create the new `IForwardConfig` interface in `classes.pp.interfaces.ts`
|
|
270
|
-
- [ ] Design the new `IDomainConfig` interface using the forwarding property
|
|
271
|
-
- [ ] Define the internal data types for expanded configuration
|
|
272
|
-
|
|
273
|
-
### Task 2: Forwarding Handlers (Week 1-2)
|
|
274
|
-
- [ ] Create abstract `ForwardingHandler` base class
|
|
275
|
-
- [ ] Implement concrete handlers for each forwarding type:
|
|
276
|
-
- [ ] `HttpForwardingHandler` - For HTTP-only configurations
|
|
277
|
-
- [ ] `HttpsPassthroughHandler` - For SNI passthrough
|
|
278
|
-
- [ ] `HttpsTerminateToHttpHandler` - For TLS termination to HTTP backends
|
|
279
|
-
- [ ] `HttpsTerminateToHttpsHandler` - For TLS termination to HTTPS backends
|
|
280
|
-
- [ ] Implement `ForwardingHandlerFactory` to create the appropriate handler
|
|
281
|
-
|
|
282
|
-
### Task 3: SmartProxy Integration (Week 2-3)
|
|
283
|
-
- [ ] Update `SmartProxy` class to use the new forwarding system
|
|
284
|
-
- [ ] Modify `ConnectionHandler` to delegate to forwarding handlers
|
|
285
|
-
- [ ] Refactor domain configuration processing to use forwarding types
|
|
286
|
-
- [ ] Update `Port80Handler` integration to work with the new system
|
|
287
|
-
|
|
288
|
-
### Task 4: Certificate Management (Week 3)
|
|
289
|
-
- [ ] Create a certificate management system that works with forwarding types
|
|
290
|
-
- [ ] Implement automatic ACME provisioning based on forwarding type
|
|
291
|
-
- [ ] Add custom certificate support
|
|
292
|
-
|
|
293
|
-
### Task 5: Testing & Helper Functions (Week 4)
|
|
294
|
-
- [ ] Create helper functions for common forwarding patterns
|
|
295
|
-
- [ ] Implement comprehensive test suite for each forwarding handler
|
|
296
|
-
- [ ] Add validation for forwarding configurations
|
|
297
|
-
|
|
298
|
-
### Task 6: Documentation (Week 4)
|
|
299
|
-
- [ ] Create detailed documentation for the new forwarding system
|
|
300
|
-
- [ ] Document the forwarding types and their use cases
|
|
301
|
-
- [ ] Update README with the new configuration examples
|
|
302
|
-
|
|
303
|
-
## Detailed Type Documentation
|
|
304
|
-
|
|
305
|
-
### Core Forwarding Types
|
|
306
|
-
|
|
307
|
-
```typescript
|
|
308
|
-
/**
|
|
309
|
-
* The primary forwarding types supported by SmartProxy
|
|
310
|
-
*/
|
|
311
|
-
export type ForwardingType =
|
|
312
|
-
| 'http-only' // HTTP forwarding only (no HTTPS)
|
|
313
|
-
| 'https-passthrough' // Pass-through TLS traffic (SNI forwarding)
|
|
314
|
-
| 'https-terminate-to-http' // Terminate TLS and forward to HTTP backend
|
|
315
|
-
| 'https-terminate-to-https'; // Terminate TLS and forward to HTTPS backend
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
### Type-Specific Behavior
|
|
319
|
-
|
|
320
|
-
Each forwarding type has specific default behavior:
|
|
321
|
-
|
|
322
|
-
#### HTTP-Only
|
|
323
|
-
- Handles only HTTP traffic
|
|
324
|
-
- No TLS/HTTPS support
|
|
325
|
-
- No certificate management
|
|
326
|
-
|
|
327
|
-
#### HTTPS Passthrough
|
|
328
|
-
- Forwards raw TLS traffic to backend (no termination)
|
|
329
|
-
- Passes SNI information through
|
|
330
|
-
- No HTTP support (TLS only)
|
|
331
|
-
- No certificate management
|
|
332
|
-
|
|
333
|
-
#### HTTPS Terminate to HTTP
|
|
334
|
-
- Terminates TLS at SmartProxy
|
|
335
|
-
- Connects to backend using HTTP (non-TLS)
|
|
336
|
-
- Manages certificates automatically (ACME)
|
|
337
|
-
- Supports HTTP requests with option to redirect to HTTPS
|
|
338
|
-
|
|
339
|
-
#### HTTPS Terminate to HTTPS
|
|
340
|
-
- Terminates client TLS at SmartProxy
|
|
341
|
-
- Creates new TLS connection to backend
|
|
342
|
-
- Manages certificates automatically (ACME)
|
|
343
|
-
- Supports HTTP requests with option to redirect to HTTPS
|
|
344
|
-
|
|
345
|
-
## Handler Implementation Strategy
|
|
346
|
-
|
|
347
|
-
```typescript
|
|
348
|
-
/**
|
|
349
|
-
* Handler for HTTP-only forwarding
|
|
350
|
-
*/
|
|
351
|
-
class HttpForwardingHandler extends ForwardingHandler {
|
|
352
|
-
public handleConnection(socket: Socket): void {
|
|
353
|
-
// Process HTTP connection
|
|
354
|
-
// For HTTP-only, we'll mostly defer to handleHttpRequest
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
public handleHttpRequest(req: IncomingMessage, res: ServerResponse): void {
|
|
358
|
-
// Forward HTTP request to target
|
|
359
|
-
const target = this.getTargetFromConfig();
|
|
360
|
-
this.proxyRequest(req, res, target);
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* Handler for HTTPS passthrough (SNI forwarding)
|
|
366
|
-
*/
|
|
367
|
-
class HttpsPassthroughHandler extends ForwardingHandler {
|
|
368
|
-
public handleConnection(socket: Socket): void {
|
|
369
|
-
// Extract SNI from TLS ClientHello if needed
|
|
370
|
-
// Forward raw TLS traffic to target without termination
|
|
371
|
-
const target = this.getTargetFromConfig();
|
|
372
|
-
this.forwardTlsConnection(socket, target);
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
public handleHttpRequest(req: IncomingMessage, res: ServerResponse): void {
|
|
376
|
-
// HTTP not supported in SNI passthrough mode
|
|
377
|
-
res.statusCode = 404;
|
|
378
|
-
res.end('HTTP not supported for this domain');
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Handler for HTTPS termination with HTTP backend
|
|
384
|
-
*/
|
|
385
|
-
class HttpsTerminateToHttpHandler extends ForwardingHandler {
|
|
386
|
-
private tlsContext: SecureContext;
|
|
387
|
-
|
|
388
|
-
public async initialize(): Promise<void> {
|
|
389
|
-
// Set up TLS termination context
|
|
390
|
-
this.tlsContext = await this.createTlsContext();
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
public handleConnection(socket: Socket): void {
|
|
394
|
-
// Terminate TLS
|
|
395
|
-
const tlsSocket = this.createTlsSocket(socket, this.tlsContext);
|
|
396
|
-
|
|
397
|
-
// Forward to HTTP backend after TLS termination
|
|
398
|
-
tlsSocket.on('data', (data) => {
|
|
399
|
-
this.forwardToHttpBackend(data);
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
public handleHttpRequest(req: IncomingMessage, res: ServerResponse): void {
|
|
404
|
-
if (this.config.http?.redirectToHttps) {
|
|
405
|
-
// Redirect to HTTPS if configured
|
|
406
|
-
this.redirectToHttps(req, res);
|
|
407
|
-
} else {
|
|
408
|
-
// Handle HTTP request
|
|
409
|
-
const target = this.getTargetFromConfig();
|
|
410
|
-
this.proxyRequest(req, res, target);
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
* Handler for HTTPS termination with HTTPS backend
|
|
417
|
-
*/
|
|
418
|
-
class HttpsTerminateToHttpsHandler extends ForwardingHandler {
|
|
419
|
-
private tlsContext: SecureContext;
|
|
420
|
-
|
|
421
|
-
public async initialize(): Promise<void> {
|
|
422
|
-
// Set up TLS termination context
|
|
423
|
-
this.tlsContext = await this.createTlsContext();
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
public handleConnection(socket: Socket): void {
|
|
427
|
-
// Terminate client TLS
|
|
428
|
-
const tlsSocket = this.createTlsSocket(socket, this.tlsContext);
|
|
429
|
-
|
|
430
|
-
// Create new TLS connection to backend
|
|
431
|
-
tlsSocket.on('data', (data) => {
|
|
432
|
-
this.forwardToHttpsBackend(data);
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
public handleHttpRequest(req: IncomingMessage, res: ServerResponse): void {
|
|
437
|
-
if (this.config.http?.redirectToHttps) {
|
|
438
|
-
// Redirect to HTTPS if configured
|
|
439
|
-
this.redirectToHttps(req, res);
|
|
440
|
-
} else {
|
|
441
|
-
// Handle HTTP request via HTTPS to backend
|
|
442
|
-
const target = this.getTargetFromConfig();
|
|
443
|
-
this.proxyRequestOverHttps(req, res, target);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
```
|
|
448
|
-
|
|
449
|
-
## Benefits of This Approach
|
|
450
|
-
|
|
451
|
-
1. **Clean, Type-Driven Design**
|
|
452
|
-
- Forwarding types clearly express intent
|
|
453
|
-
- No backward compatibility compromises
|
|
454
|
-
- Code structure follows the domain model
|
|
455
|
-
|
|
456
|
-
2. **Explicit Configuration**
|
|
457
|
-
- Configuration directly maps to behavior
|
|
458
|
-
- Reduced chance of unexpected behavior
|
|
459
|
-
|
|
460
|
-
3. **Modular Implementation**
|
|
461
|
-
- Each forwarding type handled by dedicated class
|
|
462
|
-
- Clear separation of concerns
|
|
463
|
-
- Easier to test and extend
|
|
464
|
-
|
|
465
|
-
4. **Simplified Mental Model**
|
|
466
|
-
- Users think in terms of use cases, not low-level settings
|
|
467
|
-
- Configuration matches mental model
|
|
468
|
-
|
|
469
|
-
5. **Future-Proof**
|
|
470
|
-
- Easy to add new forwarding types
|
|
471
|
-
- Clean extension points for new features
|
|
4
|
+
Standardize interface and type naming throughout the SmartProxy codebase to improve maintainability, readability, and developer experience by:
|
|
5
|
+
1. Ensuring all interfaces are prefixed with "I"
|
|
6
|
+
2. Ensuring all type aliases are prefixed with "T"
|
|
7
|
+
3. Maintaining backward compatibility through type aliases
|
|
8
|
+
4. Updating documentation to reflect naming conventions
|
|
9
|
+
|
|
10
|
+
## Phase 2: Core Module Standardization
|
|
11
|
+
|
|
12
|
+
- [ ] Update core module interfaces and types
|
|
13
|
+
- [ ] Rename interfaces in `ts/core/models/common-types.ts`
|
|
14
|
+
- [ ] `AcmeOptions` → `IAcmeOptions`
|
|
15
|
+
- [ ] `DomainOptions` → `IDomainOptions`
|
|
16
|
+
- [ ] Other common interfaces
|
|
17
|
+
- [ ] Add backward compatibility aliases
|
|
18
|
+
- [ ] Update imports throughout core module
|
|
19
|
+
|
|
20
|
+
- [ ] Update core utility type definitions
|
|
21
|
+
- [ ] Update `ts/core/utils/validation-utils.ts`
|
|
22
|
+
- [ ] Update `ts/core/utils/ip-utils.ts`
|
|
23
|
+
- [ ] Standardize event type definitions
|
|
24
|
+
|
|
25
|
+
- [ ] Test core module changes
|
|
26
|
+
- [ ] Run unit tests for core modules
|
|
27
|
+
- [ ] Verify type compatibility
|
|
28
|
+
- [ ] Ensure backward compatibility
|
|
29
|
+
|
|
30
|
+
## Phase 3: Certificate Module Standardization
|
|
31
|
+
|
|
32
|
+
- [ ] Update certificate interfaces
|
|
33
|
+
- [ ] Rename interfaces in `ts/certificate/models/certificate-types.ts`
|
|
34
|
+
- [ ] `CertificateData` → `ICertificateData`
|
|
35
|
+
- [ ] `Certificates` → `ICertificates`
|
|
36
|
+
- [ ] `CertificateFailure` → `ICertificateFailure`
|
|
37
|
+
- [ ] `CertificateExpiring` → `ICertificateExpiring`
|
|
38
|
+
- [ ] `ForwardConfig` → `IForwardConfig`
|
|
39
|
+
- [ ] `DomainForwardConfig` → `IDomainForwardConfig`
|
|
40
|
+
- [ ] Update ACME challenge interfaces
|
|
41
|
+
- [ ] Standardize storage provider interfaces
|
|
42
|
+
|
|
43
|
+
- [ ] Ensure certificate provider compatibility
|
|
44
|
+
- [ ] Update provider implementations
|
|
45
|
+
- [ ] Rename internal interfaces
|
|
46
|
+
- [ ] Maintain public API compatibility
|
|
47
|
+
|
|
48
|
+
- [ ] Test certificate module
|
|
49
|
+
- [ ] Verify ACME functionality
|
|
50
|
+
- [ ] Test certificate provisioning
|
|
51
|
+
- [ ] Validate challenge handling
|
|
52
|
+
|
|
53
|
+
## Phase 4: Forwarding System Standardization
|
|
54
|
+
|
|
55
|
+
- [ ] Update forwarding configuration interfaces
|
|
56
|
+
- [ ] Rename interfaces in `ts/forwarding/config/forwarding-types.ts`
|
|
57
|
+
- [ ] `TargetConfig` → `ITargetConfig`
|
|
58
|
+
- [ ] `HttpOptions` → `IHttpOptions`
|
|
59
|
+
- [ ] `HttpsOptions` → `IHttpsOptions`
|
|
60
|
+
- [ ] `AcmeForwardingOptions` → `IAcmeForwardingOptions`
|
|
61
|
+
- [ ] `SecurityOptions` → `ISecurityOptions`
|
|
62
|
+
- [ ] `AdvancedOptions` → `IAdvancedOptions`
|
|
63
|
+
- [ ] `ForwardConfig` → `IForwardConfig`
|
|
64
|
+
- [ ] Rename type definitions
|
|
65
|
+
- [ ] `ForwardingType` → `TForwardingType`
|
|
66
|
+
- [ ] Update domain configuration interfaces
|
|
67
|
+
|
|
68
|
+
- [ ] Standardize handler interfaces
|
|
69
|
+
- [ ] Update base handler interfaces
|
|
70
|
+
- [ ] Rename handler-specific interfaces
|
|
71
|
+
- [ ] Update factory interfaces
|
|
72
|
+
|
|
73
|
+
- [ ] Verify forwarding system functionality
|
|
74
|
+
- [ ] Test all forwarding types
|
|
75
|
+
- [ ] Verify configuration parsing
|
|
76
|
+
- [ ] Ensure backward compatibility
|
|
77
|
+
|
|
78
|
+
## Phase 5: Proxy Implementation Standardization
|
|
79
|
+
|
|
80
|
+
- [ ] Update SmartProxy interfaces
|
|
81
|
+
- [ ] Rename interfaces in `ts/proxies/smart-proxy/models/interfaces.ts`
|
|
82
|
+
- [ ] Update domain configuration interfaces
|
|
83
|
+
- [ ] Standardize manager interfaces
|
|
84
|
+
|
|
85
|
+
- [ ] Update NetworkProxy interfaces
|
|
86
|
+
- [ ] Rename in `ts/proxies/network-proxy/models/types.ts`
|
|
87
|
+
- [ ] `NetworkProxyOptions` → `INetworkProxyOptions`
|
|
88
|
+
- [ ] `CertificateEntry` → `ICertificateEntry`
|
|
89
|
+
- [ ] `ReverseProxyConfig` → `IReverseProxyConfig`
|
|
90
|
+
- [ ] `ConnectionEntry` → `IConnectionEntry`
|
|
91
|
+
- [ ] `WebSocketWithHeartbeat` → `IWebSocketWithHeartbeat`
|
|
92
|
+
- [ ] `Logger` → `ILogger`
|
|
93
|
+
- [ ] Update request handler interfaces
|
|
94
|
+
- [ ] Standardize connection interfaces
|
|
95
|
+
|
|
96
|
+
- [ ] Update NfTablesProxy interfaces
|
|
97
|
+
- [ ] Rename interfaces in `ts/proxies/nftables-proxy/models/interfaces.ts`
|
|
98
|
+
- [ ] Update configuration interfaces
|
|
99
|
+
- [ ] Standardize firewall rule interfaces
|
|
100
|
+
|
|
101
|
+
- [ ] Test proxy implementations
|
|
102
|
+
- [ ] Verify SmartProxy functionality
|
|
103
|
+
- [ ] Test NetworkProxy with renamed interfaces
|
|
104
|
+
- [ ] Validate NfTablesProxy operations
|
|
105
|
+
|
|
106
|
+
## Phase 6: HTTP & TLS Module Standardization
|
|
107
|
+
|
|
108
|
+
- [ ] Update HTTP interfaces
|
|
109
|
+
- [ ] Rename in `ts/http/port80/acme-interfaces.ts`
|
|
110
|
+
- [ ] `SmartAcmeCert` → `ISmartAcmeCert`
|
|
111
|
+
- [ ] `SmartAcmeOptions` → `ISmartAcmeOptions`
|
|
112
|
+
- [ ] `Http01Challenge` → `IHttp01Challenge`
|
|
113
|
+
- [ ] `SmartAcme` → `ISmartAcme`
|
|
114
|
+
- [ ] Standardize router interfaces
|
|
115
|
+
- [ ] Update port80 handler interfaces
|
|
116
|
+
- [ ] Update redirect interfaces
|
|
117
|
+
|
|
118
|
+
- [ ] Update TLS/SNI interfaces
|
|
119
|
+
- [ ] Standardize SNI handler interfaces
|
|
120
|
+
- [ ] Update client hello parser types
|
|
121
|
+
- [ ] Rename TLS alert interfaces
|
|
122
|
+
|
|
123
|
+
- [ ] Test HTTP & TLS functionality
|
|
124
|
+
- [ ] Verify router operation
|
|
125
|
+
- [ ] Test SNI extraction
|
|
126
|
+
- [ ] Validate redirect functionality
|
|
127
|
+
|
|
128
|
+
## Phase 7: Backward Compatibility Layer
|
|
129
|
+
|
|
130
|
+
- [ ] Implement comprehensive type aliases
|
|
131
|
+
- [ ] Create aliases for all renamed interfaces
|
|
132
|
+
- [ ] Add deprecation notices via JSDoc
|
|
133
|
+
- [ ] Ensure all exports include both named versions
|
|
134
|
+
|
|
135
|
+
- [ ] Update main entry point
|
|
136
|
+
- [ ] Update `ts/index.ts` with all exports
|
|
137
|
+
- [ ] Include both prefixed and non-prefixed names
|
|
138
|
+
- [ ] Organize exports by module
|
|
139
|
+
|
|
140
|
+
- [ ] Add compatibility documentation
|
|
141
|
+
- [ ] Document renaming strategy
|
|
142
|
+
- [ ] Provide migration examples
|
|
143
|
+
- [ ] Create deprecation timeline
|
|
144
|
+
|
|
145
|
+
## Phase 8: Documentation & Examples
|
|
146
|
+
|
|
147
|
+
- [ ] Update README and API documentation
|
|
148
|
+
- [ ] Update interface references in README.md
|
|
149
|
+
- [ ] Document naming convention in README.md
|
|
150
|
+
- [ ] Update API reference documentation
|
|
151
|
+
|
|
152
|
+
- [ ] Update examples
|
|
153
|
+
- [ ] Modify example code to use new interface names
|
|
154
|
+
- [ ] Add compatibility notes
|
|
155
|
+
- [ ] Create migration examples
|
|
156
|
+
|
|
157
|
+
- [ ] Add contributor guidelines
|
|
158
|
+
- [ ] Document naming conventions
|
|
159
|
+
- [ ] Add interface/type style guide
|
|
160
|
+
- [ ] Update PR templates
|
|
161
|
+
|
|
162
|
+
## Phase 9: Testing & Validation
|
|
163
|
+
|
|
164
|
+
- [ ] Run comprehensive test suite
|
|
165
|
+
- [ ] Run all unit tests
|
|
166
|
+
- [ ] Execute integration tests
|
|
167
|
+
- [ ] Verify example code
|
|
168
|
+
|
|
169
|
+
- [ ] Build type declarations
|
|
170
|
+
- [ ] Generate TypeScript declaration files
|
|
171
|
+
- [ ] Verify exported types
|
|
172
|
+
- [ ] Validate documentation generation
|
|
173
|
+
|
|
174
|
+
- [ ] Final compatibility check
|
|
175
|
+
- [ ] Verify import compatibility
|
|
176
|
+
- [ ] Test with existing dependent projects
|
|
177
|
+
- [ ] Validate backward compatibility claims
|
|
178
|
+
|
|
179
|
+
## Implementation Strategy
|
|
180
|
+
|
|
181
|
+
### Naming Pattern Rules
|
|
182
|
+
|
|
183
|
+
1. **Interfaces**:
|
|
184
|
+
- All interfaces should be prefixed with "I"
|
|
185
|
+
- Example: `DomainConfig` → `IDomainConfig`
|
|
186
|
+
|
|
187
|
+
2. **Type Aliases**:
|
|
188
|
+
- All type aliases should be prefixed with "T"
|
|
189
|
+
- Example: `ForwardingType` → `TForwardingType`
|
|
190
|
+
|
|
191
|
+
3. **Enums**:
|
|
192
|
+
- Enums should be named in PascalCase without prefix
|
|
193
|
+
- Example: `CertificateSource`
|
|
194
|
+
|
|
195
|
+
4. **Backward Compatibility**:
|
|
196
|
+
- No Backward compatibility. Remove old names.
|
|
197
|
+
|
|
198
|
+
### Module Implementation Order
|
|
199
|
+
|
|
200
|
+
1. Core module
|
|
201
|
+
2. Certificate module
|
|
202
|
+
3. Forwarding module
|
|
203
|
+
4. Proxy implementations
|
|
204
|
+
5. HTTP & TLS modules
|
|
205
|
+
6. Main exports and entry points
|
|
206
|
+
|
|
207
|
+
### Testing Strategy
|
|
208
|
+
|
|
209
|
+
For each module:
|
|
210
|
+
1. Rename interfaces and types
|
|
211
|
+
2. Add backward compatibility aliases
|
|
212
|
+
3. Update imports throughout the module
|
|
213
|
+
4. Run tests to verify functionality
|
|
214
|
+
5. Commit changes module by module
|
|
215
|
+
|
|
216
|
+
## File-Specific Changes
|
|
217
|
+
|
|
218
|
+
### Core Module Files
|
|
219
|
+
- `ts/core/models/common-types.ts` - Primary interfaces
|
|
220
|
+
- `ts/core/utils/validation-utils.ts` - Validation type definitions
|
|
221
|
+
- `ts/core/utils/ip-utils.ts` - IP utility type definitions
|
|
222
|
+
- `ts/core/utils/event-utils.ts` - Event type definitions
|
|
223
|
+
|
|
224
|
+
### Certificate Module Files
|
|
225
|
+
- `ts/certificate/models/certificate-types.ts` - Certificate interfaces
|
|
226
|
+
- `ts/certificate/acme/acme-factory.ts` - ACME factory types
|
|
227
|
+
- `ts/certificate/providers/cert-provisioner.ts` - Provider interfaces
|
|
228
|
+
- `ts/certificate/storage/file-storage.ts` - Storage interfaces
|
|
229
|
+
|
|
230
|
+
### Forwarding Module Files
|
|
231
|
+
- `ts/forwarding/config/forwarding-types.ts` - Forwarding interfaces and types
|
|
232
|
+
- `ts/forwarding/config/domain-config.ts` - Domain configuration
|
|
233
|
+
- `ts/forwarding/factory/forwarding-factory.ts` - Factory interfaces
|
|
234
|
+
- `ts/forwarding/handlers/*.ts` - Handler interfaces
|
|
235
|
+
|
|
236
|
+
### Proxy Module Files
|
|
237
|
+
- `ts/proxies/network-proxy/models/types.ts` - NetworkProxy interfaces
|
|
238
|
+
- `ts/proxies/smart-proxy/models/interfaces.ts` - SmartProxy interfaces
|
|
239
|
+
- `ts/proxies/nftables-proxy/models/interfaces.ts` - NfTables interfaces
|
|
240
|
+
- `ts/proxies/smart-proxy/connection-manager.ts` - Connection types
|
|
241
|
+
|
|
242
|
+
### HTTP/TLS Module Files
|
|
243
|
+
- `ts/http/models/http-types.ts` - HTTP module interfaces
|
|
244
|
+
- `ts/http/port80/acme-interfaces.ts` - ACME interfaces
|
|
245
|
+
- `ts/tls/sni/client-hello-parser.ts` - TLS parser types
|
|
246
|
+
- `ts/tls/alerts/tls-alert.ts` - TLS alert interfaces
|
|
247
|
+
|
|
248
|
+
## Success Criteria
|
|
249
|
+
|
|
250
|
+
- All interfaces are prefixed with "I"
|
|
251
|
+
- All type aliases are prefixed with "T"
|
|
252
|
+
- All tests pass with new naming conventions
|
|
253
|
+
- Documentation is updated with new naming conventions
|
|
254
|
+
- Backward compatibility is maintained through type aliases
|
|
255
|
+
- Declaration files correctly export both naming conventions
|