green-tunnel 2.0.1 → 3.0.2
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/core/config.d.ts +13 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +87 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/dns/decode.d.ts +12 -0
- package/dist/core/dns/decode.d.ts.map +1 -0
- package/dist/core/dns/decode.js +23 -0
- package/dist/core/dns/decode.js.map +1 -0
- package/dist/core/dns/doh.d.ts +19 -0
- package/dist/core/dns/doh.d.ts.map +1 -0
- package/dist/core/dns/doh.js +54 -0
- package/dist/core/dns/doh.js.map +1 -0
- package/dist/core/dns/dot.d.ts +13 -0
- package/dist/core/dns/dot.d.ts.map +1 -0
- package/dist/core/dns/dot.js +79 -0
- package/dist/core/dns/dot.js.map +1 -0
- package/dist/core/dns/index.d.ts +8 -0
- package/dist/core/dns/index.d.ts.map +1 -0
- package/dist/core/dns/index.js +18 -0
- package/dist/core/dns/index.js.map +1 -0
- package/dist/core/dns/plain.d.ts +17 -0
- package/dist/core/dns/plain.d.ts.map +1 -0
- package/dist/core/dns/plain.js +45 -0
- package/dist/core/dns/plain.js.map +1 -0
- package/dist/core/dns/resolver.d.ts +27 -0
- package/dist/core/dns/resolver.d.ts.map +1 -0
- package/dist/core/dns/resolver.js +81 -0
- package/dist/core/dns/resolver.js.map +1 -0
- package/dist/core/errors.d.ts +32 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +37 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/http/head.d.ts +40 -0
- package/dist/core/http/head.d.ts.map +1 -0
- package/dist/core/http/head.js +122 -0
- package/dist/core/http/head.js.map +1 -0
- package/dist/core/http/rewriter.d.ts +20 -0
- package/dist/core/http/rewriter.d.ts.map +1 -0
- package/dist/core/http/rewriter.js +184 -0
- package/dist/core/http/rewriter.js.map +1 -0
- package/dist/core/index.d.ts +28 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +27 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/logger.d.ts +38 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +92 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/net/socket.d.ts +30 -0
- package/dist/core/net/socket.d.ts.map +1 -0
- package/dist/core/net/socket.js +98 -0
- package/dist/core/net/socket.js.map +1 -0
- package/dist/core/proxy/connect-tunnel.d.ts +14 -0
- package/dist/core/proxy/connect-tunnel.d.ts.map +1 -0
- package/dist/core/proxy/connect-tunnel.js +44 -0
- package/dist/core/proxy/connect-tunnel.js.map +1 -0
- package/dist/core/proxy/connection.d.ts +12 -0
- package/dist/core/proxy/connection.d.ts.map +1 -0
- package/dist/core/proxy/connection.js +88 -0
- package/dist/core/proxy/connection.js.map +1 -0
- package/dist/core/proxy/context.d.ts +15 -0
- package/dist/core/proxy/context.d.ts.map +1 -0
- package/dist/core/proxy/context.js +2 -0
- package/dist/core/proxy/context.js.map +1 -0
- package/dist/core/proxy/index.d.ts +33 -0
- package/dist/core/proxy/index.d.ts.map +1 -0
- package/dist/core/proxy/index.js +162 -0
- package/dist/core/proxy/index.js.map +1 -0
- package/dist/core/proxy/pipe.d.ts +12 -0
- package/dist/core/proxy/pipe.d.ts.map +1 -0
- package/dist/core/proxy/pipe.js +42 -0
- package/dist/core/proxy/pipe.js.map +1 -0
- package/dist/core/proxy/plain-tunnel.d.ts +12 -0
- package/dist/core/proxy/plain-tunnel.d.ts.map +1 -0
- package/dist/core/proxy/plain-tunnel.js +29 -0
- package/dist/core/proxy/plain-tunnel.js.map +1 -0
- package/dist/core/system-proxy/darwin.d.ts +32 -0
- package/dist/core/system-proxy/darwin.d.ts.map +1 -0
- package/dist/core/system-proxy/darwin.js +146 -0
- package/dist/core/system-proxy/darwin.js.map +1 -0
- package/dist/core/system-proxy/driver.d.ts +21 -0
- package/dist/core/system-proxy/driver.d.ts.map +1 -0
- package/dist/core/system-proxy/driver.js +2 -0
- package/dist/core/system-proxy/driver.js.map +1 -0
- package/dist/core/system-proxy/exec.d.ts +21 -0
- package/dist/core/system-proxy/exec.d.ts.map +1 -0
- package/dist/core/system-proxy/exec.js +62 -0
- package/dist/core/system-proxy/exec.js.map +1 -0
- package/dist/core/system-proxy/index.d.ts +45 -0
- package/dist/core/system-proxy/index.d.ts.map +1 -0
- package/dist/core/system-proxy/index.js +151 -0
- package/dist/core/system-proxy/index.js.map +1 -0
- package/dist/core/system-proxy/linux.d.ts +18 -0
- package/dist/core/system-proxy/linux.d.ts.map +1 -0
- package/dist/core/system-proxy/linux.js +100 -0
- package/dist/core/system-proxy/linux.js.map +1 -0
- package/dist/core/system-proxy/recovery.d.ts +23 -0
- package/dist/core/system-proxy/recovery.d.ts.map +1 -0
- package/dist/core/system-proxy/recovery.js +147 -0
- package/dist/core/system-proxy/recovery.js.map +1 -0
- package/dist/core/system-proxy/windows.d.ts +15 -0
- package/dist/core/system-proxy/windows.d.ts.map +1 -0
- package/dist/core/system-proxy/windows.js +96 -0
- package/dist/core/system-proxy/windows.js.map +1 -0
- package/dist/core/tls/fragment.d.ts +28 -0
- package/dist/core/tls/fragment.d.ts.map +1 -0
- package/dist/core/tls/fragment.js +81 -0
- package/dist/core/tls/fragment.js.map +1 -0
- package/dist/core/types.d.ts +138 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +7 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +155 -0
- package/dist/main.js.map +1 -0
- package/dist/options.d.ts +25 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +144 -0
- package/dist/options.js.map +1 -0
- package/dist/ui.d.ts +17 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +89 -0
- package/dist/ui.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +13 -0
- package/dist/version.js.map +1 -0
- package/package.json +31 -30
- package/LICENSE +0 -21
- package/README.md +0 -168
- package/bin/gt.js +0 -170
- package/src/config.js +0 -15
- package/src/dns/base.js +0 -47
- package/src/dns/https.js +0 -30
- package/src/dns/tls.js +0 -15
- package/src/dns/unencrypted.js +0 -25
- package/src/handlers/http.js +0 -65
- package/src/handlers/https.js +0 -78
- package/src/handlers/request.js +0 -32
- package/src/http/request.js +0 -45
- package/src/http/response.js +0 -45
- package/src/http/utils.js +0 -86
- package/src/index.cjs +0 -7
- package/src/index.js +0 -4
- package/src/logger.js +0 -11
- package/src/proxy.js +0 -74
- package/src/scripts/windows/wininet-reset-settings.ps1 +0 -14
- package/src/utils/analytics.js +0 -59
- package/src/utils/buffer.js +0 -35
- package/src/utils/socket.js +0 -32
- package/src/utils/system-proxy.js +0 -153
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public shape of everything the engine can be configured with, plus the
|
|
3
|
+
* events and stats it reports back. Kept dependency-free so the CLI, the
|
|
4
|
+
* Electron main process and the renderer can all share these types.
|
|
5
|
+
*/
|
|
6
|
+
/** Recursive `Partial` used for user-supplied overrides. Arrays stay atomic. */
|
|
7
|
+
export type DeepPartial<T> = {
|
|
8
|
+
[K in keyof T]?: T[K] extends readonly (infer _U)[] ? T[K] : T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* - `doh` DNS over HTTPS (RFC 8484 wire format) — works with any DoH server.
|
|
12
|
+
* - `dot` DNS over TLS (RFC 7858) on port 853.
|
|
13
|
+
* - `plain` Unencrypted UDP/TCP DNS. Fast, but the resolver sees every lookup.
|
|
14
|
+
*/
|
|
15
|
+
export type DnsMode = 'doh' | 'dot' | 'plain';
|
|
16
|
+
/** Which address families to ask for, in preference order. */
|
|
17
|
+
export type IpFamilyPreference = 'ipv4' | 'ipv6' | 'ipv4-first' | 'ipv6-first';
|
|
18
|
+
export interface DnsSettings {
|
|
19
|
+
readonly mode: DnsMode;
|
|
20
|
+
/** DoH endpoint. Used when `mode` is `doh`. */
|
|
21
|
+
readonly dohUrl: string;
|
|
22
|
+
/** DoT server hostname. Used when `mode` is `dot`. */
|
|
23
|
+
readonly dotHost: string;
|
|
24
|
+
readonly dotPort: number;
|
|
25
|
+
/** Plain resolvers. Used when `mode` is `plain`. Empty means "OS defaults". */
|
|
26
|
+
readonly plainServers: readonly string[];
|
|
27
|
+
readonly family: IpFamilyPreference;
|
|
28
|
+
/** Max distinct hostnames held in the resolver cache. */
|
|
29
|
+
readonly cacheSize: number;
|
|
30
|
+
/** Record TTLs are clamped into this range, in seconds. */
|
|
31
|
+
readonly minTtlSeconds: number;
|
|
32
|
+
readonly maxTtlSeconds: number;
|
|
33
|
+
/** Abort a single DNS query after this long. */
|
|
34
|
+
readonly timeoutMs: number;
|
|
35
|
+
}
|
|
36
|
+
export interface DnsRecord {
|
|
37
|
+
readonly address: string;
|
|
38
|
+
readonly family: 4 | 6;
|
|
39
|
+
/** Seconds, as reported by the authoritative answer (before clamping). */
|
|
40
|
+
readonly ttl: number;
|
|
41
|
+
}
|
|
42
|
+
export interface FragmentSettings {
|
|
43
|
+
readonly enabled: boolean;
|
|
44
|
+
/** Bytes per outgoing piece of the ClientHello. */
|
|
45
|
+
readonly size: number;
|
|
46
|
+
/**
|
|
47
|
+
* When true each piece is re-framed as its own valid TLS record, so a DPI box
|
|
48
|
+
* that reassembles at the record layer still never sees a whole SNI in one
|
|
49
|
+
* record. When false the ClientHello is merely split across TCP segments.
|
|
50
|
+
*/
|
|
51
|
+
readonly tlsRecords: boolean;
|
|
52
|
+
/** Pause between pieces. Defeats boxes that reassemble on a short timer. */
|
|
53
|
+
readonly delayMs: number;
|
|
54
|
+
}
|
|
55
|
+
export interface ProxySettings {
|
|
56
|
+
readonly host: string;
|
|
57
|
+
readonly port: number;
|
|
58
|
+
/** Reject plain-HTTP (non-CONNECT) requests instead of proxying them. */
|
|
59
|
+
readonly httpsOnly: boolean;
|
|
60
|
+
/** Give up on the upstream TCP handshake after this long. */
|
|
61
|
+
readonly connectTimeoutMs: number;
|
|
62
|
+
/** Tear down a tunnel after this long with no traffic. 0 disables. */
|
|
63
|
+
readonly idleTimeoutMs: number;
|
|
64
|
+
readonly fragment: FragmentSettings;
|
|
65
|
+
readonly dns: DnsSettings;
|
|
66
|
+
}
|
|
67
|
+
export type ProxyOptions = DeepPartial<ProxySettings>;
|
|
68
|
+
export interface ProxyAddress {
|
|
69
|
+
readonly host: string;
|
|
70
|
+
readonly port: number;
|
|
71
|
+
}
|
|
72
|
+
export type TunnelKind = 'https' | 'http';
|
|
73
|
+
export interface TunnelInfo {
|
|
74
|
+
readonly id: number;
|
|
75
|
+
readonly kind: TunnelKind;
|
|
76
|
+
readonly host: string;
|
|
77
|
+
readonly port: number;
|
|
78
|
+
readonly startedAt: number;
|
|
79
|
+
}
|
|
80
|
+
export interface ProxyStats {
|
|
81
|
+
readonly activeTunnels: number;
|
|
82
|
+
readonly totalTunnels: number;
|
|
83
|
+
readonly failedTunnels: number;
|
|
84
|
+
readonly bytesSent: number;
|
|
85
|
+
readonly bytesReceived: number;
|
|
86
|
+
/** Epoch ms, or `null` while stopped. */
|
|
87
|
+
readonly startedAt: number | null;
|
|
88
|
+
}
|
|
89
|
+
export interface ProxyEventMap {
|
|
90
|
+
listening: [ProxyAddress];
|
|
91
|
+
close: [];
|
|
92
|
+
error: [Error];
|
|
93
|
+
'tunnel:open': [TunnelInfo];
|
|
94
|
+
'tunnel:close': [TunnelInfo & {
|
|
95
|
+
bytesSent: number;
|
|
96
|
+
bytesReceived: number;
|
|
97
|
+
}];
|
|
98
|
+
'tunnel:error': [TunnelInfo, Error];
|
|
99
|
+
}
|
|
100
|
+
export interface SystemProxySettings {
|
|
101
|
+
readonly host: string;
|
|
102
|
+
readonly port: number;
|
|
103
|
+
/** Hosts that should bypass the proxy, e.g. `localhost`, `*.local`. */
|
|
104
|
+
readonly bypass: readonly string[];
|
|
105
|
+
}
|
|
106
|
+
/** Opaque snapshot of the OS proxy configuration, used to restore it later. */
|
|
107
|
+
export interface SystemProxySnapshot {
|
|
108
|
+
readonly platform: NodeJS.Platform;
|
|
109
|
+
readonly entries: readonly SystemProxySnapshotEntry[];
|
|
110
|
+
/**
|
|
111
|
+
* PID that took the snapshot, so an orphaned snapshot left on disk by a
|
|
112
|
+
* crashed run can be told apart from one a *live* process still owns.
|
|
113
|
+
*/
|
|
114
|
+
readonly pid?: number;
|
|
115
|
+
}
|
|
116
|
+
/** One proxy endpoint. macOS keeps HTTP and HTTPS independent of each other. */
|
|
117
|
+
export interface ProxyEndpointState {
|
|
118
|
+
readonly enabled: boolean;
|
|
119
|
+
readonly host: string;
|
|
120
|
+
readonly port: number;
|
|
121
|
+
}
|
|
122
|
+
export interface SystemProxySnapshotEntry extends ProxyEndpointState {
|
|
123
|
+
/** Network service (macOS), schema key (Linux) or registry value (Windows). */
|
|
124
|
+
readonly target: string;
|
|
125
|
+
/**
|
|
126
|
+
* The HTTPS proxy, when the platform tracks it separately from HTTP. Restoring
|
|
127
|
+
* both from one reading would clobber a service configured with only one of
|
|
128
|
+
* the two — a real state we found in the wild.
|
|
129
|
+
*/
|
|
130
|
+
readonly secure?: ProxyEndpointState;
|
|
131
|
+
/**
|
|
132
|
+
* The bypass/exceptions list, recorded because `apply` overwrites it. v3.0
|
|
133
|
+
* set it and never put it back, permanently burning our list into every
|
|
134
|
+
* service it touched.
|
|
135
|
+
*/
|
|
136
|
+
readonly bypass?: readonly string[];
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,gFAAgF;AAChF,MAAM,MAAM,WAAW,CAAC,CAAC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AM,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public shape of everything the engine can be configured with, plus the
|
|
3
|
+
* events and stats it reports back. Kept dependency-free so the CLI, the
|
|
4
|
+
* Electron main process and the renderer can all share these types.
|
|
5
|
+
*/
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Library surface of the `green-tunnel` package.
|
|
3
|
+
*
|
|
4
|
+
* v2 published the engine under this name and v3 does again, so `import { Proxy }
|
|
5
|
+
* from 'green-tunnel'` has never stopped working. The engine lives in `./core`,
|
|
6
|
+
* which was briefly a separate `@green-tunnel/core` package and is not published
|
|
7
|
+
* on its own — one package, one version, no scope to own.
|
|
8
|
+
*/
|
|
9
|
+
export * from './core/index.js';
|
|
10
|
+
export { VERSION } from './version.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Library surface of the `green-tunnel` package.
|
|
3
|
+
*
|
|
4
|
+
* v2 published the engine under this name and v3 does again, so `import { Proxy }
|
|
5
|
+
* from 'green-tunnel'` has never stopped working. The engine lives in `./core`,
|
|
6
|
+
* which was briefly a separate `@green-tunnel/core` package and is not published
|
|
7
|
+
* on its own — one package, one version, no scope to own.
|
|
8
|
+
*/
|
|
9
|
+
export * from './core/index.js';
|
|
10
|
+
export { VERSION } from './version.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":""}
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import process from 'node:process';
|
|
3
|
+
import { DEFAULT_BYPASS, Proxy, SystemProxy, createLogger, isSystemProxySupported, recoverSystemProxy, toError, } from './core/index.js';
|
|
4
|
+
import { HELP_TEXT, UsageError, parseCliArgs } from './options.js';
|
|
5
|
+
import { printBanner, printError, printNotice, printStatus, printStopped, printStopping, } from './ui.js';
|
|
6
|
+
import { VERSION } from './version.js';
|
|
7
|
+
async function main() {
|
|
8
|
+
let parsed;
|
|
9
|
+
try {
|
|
10
|
+
parsed = parseCliArgs(process.argv.slice(2));
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
if (error instanceof UsageError) {
|
|
14
|
+
printError(error.message);
|
|
15
|
+
printNotice('Run `gt --help` for usage.');
|
|
16
|
+
return 2;
|
|
17
|
+
}
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
if (parsed.kind === 'help') {
|
|
21
|
+
console.log(HELP_TEXT);
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
24
|
+
if (parsed.kind === 'version') {
|
|
25
|
+
console.log(VERSION);
|
|
26
|
+
return 0;
|
|
27
|
+
}
|
|
28
|
+
return run(parsed.options);
|
|
29
|
+
}
|
|
30
|
+
async function run(options) {
|
|
31
|
+
const logger = createLogger({ level: options.logLevel });
|
|
32
|
+
// Before anything else: if a previous run was killed without cleaning up, the
|
|
33
|
+
// machine may still be pointed at a dead port. Undo that first — it is the
|
|
34
|
+
// difference between "the internet is broken" and a working machine, and it
|
|
35
|
+
// must happen whether or not this run manages the system proxy at all.
|
|
36
|
+
if (isSystemProxySupported()) {
|
|
37
|
+
try {
|
|
38
|
+
const recovered = await recoverSystemProxy();
|
|
39
|
+
if (recovered) {
|
|
40
|
+
printNotice(`Restored the system proxy left behind by a previous run (${String(recovered.entries.length)} ` +
|
|
41
|
+
`${recovered.entries.length === 1 ? 'entry' : 'entries'}).`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
printError(toError(error).message);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const proxy = new Proxy(options.proxy, { logger });
|
|
49
|
+
// Without a listener, an emitted `error` would throw out of the event loop.
|
|
50
|
+
proxy.on('error', (error) => {
|
|
51
|
+
logger.error(error.message, error);
|
|
52
|
+
});
|
|
53
|
+
const address = await proxy.start();
|
|
54
|
+
const system = options.systemProxy && isSystemProxySupported() ? new SystemProxy() : undefined;
|
|
55
|
+
if (options.systemProxy && !system) {
|
|
56
|
+
printNotice(`System proxy is not supported on ${process.platform}; configure it manually.`);
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
await system?.enable({ host: address.host, port: address.port, bypass: DEFAULT_BYPASS });
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
printNotice(`Could not set the system proxy: ${toError(error).message}`);
|
|
63
|
+
}
|
|
64
|
+
// Whether *we* actually changed the OS — the only thing that makes teardown
|
|
65
|
+
// slow, and the only thing worth reassuring the user about on the way out.
|
|
66
|
+
const managingSystemProxy = system?.active ?? false;
|
|
67
|
+
if (!options.quiet) {
|
|
68
|
+
printBanner();
|
|
69
|
+
printStatus(address, proxy.settings, managingSystemProxy);
|
|
70
|
+
}
|
|
71
|
+
await waitForShutdown(async () => {
|
|
72
|
+
// Restore the OS first: leaving the machine pointed at a dead port is the
|
|
73
|
+
// worst possible failure mode.
|
|
74
|
+
let restored = managingSystemProxy;
|
|
75
|
+
await system?.disable().catch((error) => {
|
|
76
|
+
restored = false;
|
|
77
|
+
printError(`Could not restore the system proxy: ${toError(error).message}`);
|
|
78
|
+
printNotice('Run `gt` again to retry, or clear the proxy in your network settings.');
|
|
79
|
+
});
|
|
80
|
+
await proxy.stop();
|
|
81
|
+
if (!options.quiet)
|
|
82
|
+
printStopped(restored);
|
|
83
|
+
}, { managingSystemProxy, quiet: options.quiet });
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
/** How long teardown gets before we stop waiting and exit anyway. */
|
|
87
|
+
const SHUTDOWN_TIMEOUT_MS = 15_000;
|
|
88
|
+
/**
|
|
89
|
+
* Resolve once the process has been asked to stop and `cleanup` has finished.
|
|
90
|
+
*
|
|
91
|
+
* v2 logged `uncaughtException` and carried on with a half-dead proxy while the
|
|
92
|
+
* OS still pointed at it. Here any fatal condition runs the same teardown.
|
|
93
|
+
*
|
|
94
|
+
* Signals use `process.on`, not `process.once`, on purpose. With `once`, the
|
|
95
|
+
* handler is removed as soon as it fires, so a second Ctrl-C — exactly what an
|
|
96
|
+
* impatient user does while "restoring…" is on screen — hits Node's default
|
|
97
|
+
* SIGINT action and kills the process *mid-restore*, stranding every service
|
|
98
|
+
* the restore had not reached yet. Repeat signals are now absorbed instead.
|
|
99
|
+
*/
|
|
100
|
+
function waitForShutdown(cleanup, view) {
|
|
101
|
+
return new Promise((resolve) => {
|
|
102
|
+
let shuttingDown = false;
|
|
103
|
+
const stop = (reason) => {
|
|
104
|
+
if (shuttingDown) {
|
|
105
|
+
// Always printed, even under --quiet: this is the message that keeps an
|
|
106
|
+
// impatient user from killing us mid-restore.
|
|
107
|
+
printNotice(view.managingSystemProxy
|
|
108
|
+
? 'Still restoring your network settings — one moment.'
|
|
109
|
+
: 'Still shutting down — one moment.');
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
shuttingDown = true;
|
|
113
|
+
if (reason !== 'signal')
|
|
114
|
+
printError(reason);
|
|
115
|
+
if (!view.quiet)
|
|
116
|
+
printStopping(view.managingSystemProxy);
|
|
117
|
+
// Never hang forever on a wedged `networksetup`/`gsettings` call: the
|
|
118
|
+
// recovery file means the next run can finish the job.
|
|
119
|
+
const timer = setTimeout(() => {
|
|
120
|
+
printError('Teardown timed out.');
|
|
121
|
+
resolve();
|
|
122
|
+
}, SHUTDOWN_TIMEOUT_MS);
|
|
123
|
+
timer.unref();
|
|
124
|
+
void cleanup().finally(() => {
|
|
125
|
+
clearTimeout(timer);
|
|
126
|
+
resolve();
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
// SIGHUP matters as much as SIGINT here: closing the terminal window is a
|
|
130
|
+
// completely ordinary way to stop a foreground CLI, and v3.0 ignored it —
|
|
131
|
+
// Node's default action killed the process with the proxy still set.
|
|
132
|
+
for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) {
|
|
133
|
+
process.on(signal, () => {
|
|
134
|
+
stop('signal');
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
process.once('uncaughtException', (error) => {
|
|
138
|
+
stop(`Fatal error: ${toError(error).message}`);
|
|
139
|
+
});
|
|
140
|
+
process.once('unhandledRejection', (error) => {
|
|
141
|
+
stop(`Unhandled rejection: ${toError(error).message}`);
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
try {
|
|
146
|
+
process.exitCode = await main();
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
const failure = toError(error);
|
|
150
|
+
printError(failure.code === 'EADDRINUSE'
|
|
151
|
+
? 'That port is already in use — pick another with --port.'
|
|
152
|
+
: failure.message);
|
|
153
|
+
process.exitCode = 1;
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AACA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EACL,cAAc,EACd,KAAK,EACL,WAAW,EACX,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,OAAO,GACR,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAC;AACpF,OAAO,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,KAAK,UAAU,IAAI;IACjB,IAAI,MAAM,CAAC;IACX,IAAI,CAAC;QACH,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,UAAU,EAAE,CAAC;YAChC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC1B,WAAW,CAAC,4BAA4B,CAAC,CAAC;YAC1C,OAAO,CAAC,CAAC;QACX,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACvB,OAAO,CAAC,CAAC;IACX,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,OAA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E,CAAC;YAC9D,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;gBACtB,IAAI,CAAC,QAAQ,CAAC,CAAC;YACjB,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;YAC1C,IAAI,CAAC,gBAAgB,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,KAAK,EAAE,EAAE;YAC3C,IAAI,CAAC,wBAAwB,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,IAAI,CAAC;IACH,OAAO,CAAC,QAAQ,GAAG,MAAM,IAAI,EAAE,CAAC;AAClC,CAAC;AAAC,OAAO,KAAK,EAAE,CAAC;IACf,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/B,UAAU,CACP,OAAiC,CAAC,IAAI,KAAK,YAAY;QACtD,CAAC,CAAC,yDAAyD;QAC3D,CAAC,CAAC,OAAO,CAAC,OAAO,CACpB,CAAC;IACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type LogLevel, type ProxyOptions } from './core/index.js';
|
|
2
|
+
export interface RunOptions {
|
|
3
|
+
readonly proxy: ProxyOptions;
|
|
4
|
+
readonly systemProxy: boolean;
|
|
5
|
+
readonly logLevel: LogLevel;
|
|
6
|
+
readonly quiet: boolean;
|
|
7
|
+
}
|
|
8
|
+
export type ParseResult = {
|
|
9
|
+
readonly kind: 'run';
|
|
10
|
+
readonly options: RunOptions;
|
|
11
|
+
} | {
|
|
12
|
+
readonly kind: 'help';
|
|
13
|
+
} | {
|
|
14
|
+
readonly kind: 'version';
|
|
15
|
+
};
|
|
16
|
+
export declare class UsageError extends Error {
|
|
17
|
+
readonly name = "UsageError";
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Argument parsing on `node:util.parseArgs` — no yargs, no dependencies.
|
|
21
|
+
* `allowNegative` gives us `--no-fragment` / `--no-system-proxy` for free.
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseCliArgs(argv: readonly string[]): ParseResult;
|
|
24
|
+
export declare const HELP_TEXT: string;
|
|
25
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AACA,OAAO,EAAgC,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEjG,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;CAAE,GACtD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAEjC,qBAAa,UAAW,SAAQ,KAAK;IACnC,SAAkB,IAAI,gBAAgB;CACvC;AAKD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,WAAW,CA+EjE;AAwBD,eAAO,MAAM,SAAS,QAuCd,CAAC"}
|
package/dist/options.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { parseArgs } from 'node:util';
|
|
2
|
+
import { DEFAULT_SETTINGS, isLogLevel } from './core/index.js';
|
|
3
|
+
export class UsageError extends Error {
|
|
4
|
+
name = 'UsageError';
|
|
5
|
+
}
|
|
6
|
+
const DNS_MODES = ['doh', 'dot', 'plain'];
|
|
7
|
+
const FAMILIES = ['ipv4', 'ipv6', 'ipv4-first', 'ipv6-first'];
|
|
8
|
+
/**
|
|
9
|
+
* Argument parsing on `node:util.parseArgs` — no yargs, no dependencies.
|
|
10
|
+
* `allowNegative` gives us `--no-fragment` / `--no-system-proxy` for free.
|
|
11
|
+
*/
|
|
12
|
+
export function parseCliArgs(argv) {
|
|
13
|
+
let parsed;
|
|
14
|
+
try {
|
|
15
|
+
parsed = parseArgs({
|
|
16
|
+
args: [...argv],
|
|
17
|
+
allowNegative: true,
|
|
18
|
+
strict: true,
|
|
19
|
+
options: {
|
|
20
|
+
host: { type: 'string' },
|
|
21
|
+
port: { type: 'string', short: 'p' },
|
|
22
|
+
'https-only': { type: 'boolean', default: false },
|
|
23
|
+
fragment: { type: 'boolean', default: true },
|
|
24
|
+
'fragment-size': { type: 'string' },
|
|
25
|
+
'fragment-delay': { type: 'string' },
|
|
26
|
+
'tls-records': { type: 'boolean', default: false },
|
|
27
|
+
dns: { type: 'string' },
|
|
28
|
+
'doh-url': { type: 'string' },
|
|
29
|
+
'dot-host': { type: 'string' },
|
|
30
|
+
'dot-port': { type: 'string' },
|
|
31
|
+
'dns-server': { type: 'string', multiple: true },
|
|
32
|
+
family: { type: 'string' },
|
|
33
|
+
'system-proxy': { type: 'boolean', default: true },
|
|
34
|
+
'log-level': { type: 'string' },
|
|
35
|
+
quiet: { type: 'boolean', short: 'q', default: false },
|
|
36
|
+
help: { type: 'boolean', short: 'h', default: false },
|
|
37
|
+
version: { type: 'boolean', short: 'V', default: false },
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
catch (cause) {
|
|
42
|
+
throw new UsageError(cause instanceof Error ? cause.message : String(cause));
|
|
43
|
+
}
|
|
44
|
+
const values = parsed.values;
|
|
45
|
+
if (values.help)
|
|
46
|
+
return { kind: 'help' };
|
|
47
|
+
if (values.version)
|
|
48
|
+
return { kind: 'version' };
|
|
49
|
+
const logLevel = values['log-level'];
|
|
50
|
+
if (logLevel !== undefined && !isLogLevel(logLevel)) {
|
|
51
|
+
throw new UsageError(`--log-level must be one of silent, error, warn, info, debug, trace`);
|
|
52
|
+
}
|
|
53
|
+
const proxy = {
|
|
54
|
+
...(values.host === undefined ? {} : { host: values.host }),
|
|
55
|
+
...(values.port === undefined ? {} : { port: integer('--port', values.port, 0, 65_535) }),
|
|
56
|
+
httpsOnly: values['https-only'],
|
|
57
|
+
fragment: {
|
|
58
|
+
enabled: values.fragment,
|
|
59
|
+
tlsRecords: values['tls-records'],
|
|
60
|
+
...(values['fragment-size'] === undefined
|
|
61
|
+
? {}
|
|
62
|
+
: { size: integer('--fragment-size', values['fragment-size'], 1, 16_384) }),
|
|
63
|
+
...(values['fragment-delay'] === undefined
|
|
64
|
+
? {}
|
|
65
|
+
: { delayMs: integer('--fragment-delay', values['fragment-delay'], 0, 60_000) }),
|
|
66
|
+
},
|
|
67
|
+
dns: {
|
|
68
|
+
mode: oneOf('--dns', values.dns, DNS_MODES, DEFAULT_SETTINGS.dns.mode),
|
|
69
|
+
family: oneOf('--family', values.family, FAMILIES, DEFAULT_SETTINGS.dns.family),
|
|
70
|
+
...(values['doh-url'] === undefined ? {} : { dohUrl: values['doh-url'] }),
|
|
71
|
+
...(values['dot-host'] === undefined ? {} : { dotHost: values['dot-host'] }),
|
|
72
|
+
...(values['dot-port'] === undefined
|
|
73
|
+
? {}
|
|
74
|
+
: { dotPort: integer('--dot-port', values['dot-port'], 1, 65_535) }),
|
|
75
|
+
...(values['dns-server'] === undefined ? {} : { plainServers: values['dns-server'] }),
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
return {
|
|
79
|
+
kind: 'run',
|
|
80
|
+
options: {
|
|
81
|
+
proxy,
|
|
82
|
+
systemProxy: values['system-proxy'],
|
|
83
|
+
logLevel: logLevel ?? (values.quiet ? 'silent' : 'error'),
|
|
84
|
+
quiet: values.quiet,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function integer(flag, raw, min, max) {
|
|
89
|
+
const value = Number.parseInt(raw, 10);
|
|
90
|
+
if (!Number.isInteger(value) || value < min || value > max) {
|
|
91
|
+
throw new UsageError(`${flag} must be an integer between ${String(min)} and ${String(max)}`);
|
|
92
|
+
}
|
|
93
|
+
return value;
|
|
94
|
+
}
|
|
95
|
+
function oneOf(flag, raw, allowed, fallback) {
|
|
96
|
+
if (raw === undefined)
|
|
97
|
+
return fallback;
|
|
98
|
+
const match = allowed.find((value) => value === raw);
|
|
99
|
+
if (!match) {
|
|
100
|
+
throw new UsageError(`${flag} must be one of ${allowed.join(', ')}`);
|
|
101
|
+
}
|
|
102
|
+
return match;
|
|
103
|
+
}
|
|
104
|
+
export const HELP_TEXT = `
|
|
105
|
+
Usage: gt [options]
|
|
106
|
+
|
|
107
|
+
Runs a local proxy that splits the TLS ClientHello so DPI systems cannot read
|
|
108
|
+
the SNI, and resolves hostnames over encrypted DNS.
|
|
109
|
+
|
|
110
|
+
Server
|
|
111
|
+
--host <ip> Address to bind (default: ${DEFAULT_SETTINGS.host})
|
|
112
|
+
-p, --port <n> Port to bind, 0 = random (default: ${String(DEFAULT_SETTINGS.port)})
|
|
113
|
+
--https-only Reject plain HTTP requests
|
|
114
|
+
|
|
115
|
+
Fragmentation
|
|
116
|
+
--no-fragment Forward the ClientHello untouched
|
|
117
|
+
--fragment-size <n> Bytes per piece (default: ${String(DEFAULT_SETTINGS.fragment.size)})
|
|
118
|
+
--tls-records Re-frame pieces as valid TLS records
|
|
119
|
+
--fragment-delay <ms> Pause between pieces (default: ${String(DEFAULT_SETTINGS.fragment.delayMs)})
|
|
120
|
+
|
|
121
|
+
DNS
|
|
122
|
+
--dns <mode> doh | dot | plain (default: ${DEFAULT_SETTINGS.dns.mode})
|
|
123
|
+
--doh-url <url> DoH endpoint (default: ${DEFAULT_SETTINGS.dns.dohUrl})
|
|
124
|
+
--dot-host <host> DoT server (default: ${DEFAULT_SETTINGS.dns.dotHost})
|
|
125
|
+
--dot-port <n> DoT port (default: ${String(DEFAULT_SETTINGS.dns.dotPort)})
|
|
126
|
+
--dns-server <ip> Plain resolver, repeatable
|
|
127
|
+
--family <pref> ipv4 | ipv6 | ipv4-first | ipv6-first
|
|
128
|
+
|
|
129
|
+
Other
|
|
130
|
+
--no-system-proxy Do not touch the OS proxy settings
|
|
131
|
+
--log-level <level> silent | error | warn | info | debug | trace
|
|
132
|
+
-q, --quiet No banner, no logs
|
|
133
|
+
-h, --help Show this help
|
|
134
|
+
-V, --version Show the version
|
|
135
|
+
|
|
136
|
+
Examples
|
|
137
|
+
gt
|
|
138
|
+
gt --port 8080 --tls-records
|
|
139
|
+
gt --dns dot --dot-host 9.9.9.9
|
|
140
|
+
gt --dns plain --dns-server 1.1.1.1 --no-system-proxy
|
|
141
|
+
|
|
142
|
+
Issues: https://github.com/SadeghHayeri/GreenTunnel/issues
|
|
143
|
+
`.trim();
|
|
144
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAoC,MAAM,iBAAiB,CAAC;AAcjG,MAAM,OAAO,UAAW,SAAQ,KAAK;IACjB,IAAI,GAAG,YAAY,CAAC;CACvC;AAED,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAU,CAAC;AACnD,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,CAAU,CAAC;AAEvE;;;GAGG;AACH,MAAM,U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AC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;gEAOuC,gBAAgB,CAAC,IAAI;gEACrB,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC;;;;;gEAK7B,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;;gEAEtC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC;;;gEAGzC,gBAAgB,CAAC,GAAG,CAAC,IAAI;gEACzB,gBAAgB,CAAC,GAAG,CAAC,MAAM;gEAC3B,gBAAgB,CAAC,GAAG,CAAC,OAAO;gEAC5B,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;CAkBnG,CAAC,IAAI,EAAE,CAAC"}
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ProxyAddress, ProxySettings } from './core/index.js';
|
|
2
|
+
export declare function printBanner(): void;
|
|
3
|
+
export declare function printStatus(address: ProxyAddress, settings: ProxySettings, systemProxy: boolean): void;
|
|
4
|
+
/**
|
|
5
|
+
* Acknowledge the stop request before teardown starts.
|
|
6
|
+
*
|
|
7
|
+
* Restoring the system proxy means several `networksetup`/`gsettings` calls,
|
|
8
|
+
* which take long enough that a silent CLI looks wedged — and the user's next
|
|
9
|
+
* move is a second Ctrl-C, the one thing that can strand their network
|
|
10
|
+
* settings. So say what is happening, and say it is worth waiting for.
|
|
11
|
+
*/
|
|
12
|
+
export declare function printStopping(restoresSystemProxy: boolean): void;
|
|
13
|
+
/** Confirm teardown finished, so the user knows the machine is clean. */
|
|
14
|
+
export declare function printStopped(restoredSystemProxy: boolean): void;
|
|
15
|
+
export declare function printError(message: string): void;
|
|
16
|
+
export declare function printNotice(message: string): void;
|
|
17
|
+
//# sourceMappingURL=ui.d.ts.map
|
package/dist/ui.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AA+BnE,wBAAgB,WAAW,IAAI,IAAI,CAWlC;AAED,wBAAgB,WAAW,CACzB,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,aAAa,EACvB,WAAW,EAAE,OAAO,GACnB,IAAI,CAsBN;AAeD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAUhE;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAG/D;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEjD"}
|