pac-proxy-cli 0.1.5 → 0.1.7
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/package.json +2 -1
- package/src/cli/start.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pac-proxy-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "HTTP 代理与隧道 CLI + Web 管理面板",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"dotenv": "^16.6.1",
|
|
23
23
|
"express": "^4.21.0",
|
|
24
24
|
"open": "^10.0.0",
|
|
25
|
+
"proxy": "^2.2.0",
|
|
25
26
|
"socks": "^2.8.0"
|
|
26
27
|
}
|
|
27
28
|
}
|
package/src/cli/start.js
CHANGED
|
@@ -11,11 +11,11 @@ export async function startProxyAndPanel(options) {
|
|
|
11
11
|
const proxyPort = Number(options.port) || DEFAULT_PROXY_PORT;
|
|
12
12
|
const panelPort = Number(options.panelPort) || DEFAULT_PANEL_PORT;
|
|
13
13
|
const socks = options.socks;
|
|
14
|
-
const serverUrl = String(options.server === true ? (process.env.PROXY_SERVER_URL || '') : (options.server || process.env.PROXY_SERVER_URL || '')).trim();
|
|
14
|
+
const serverUrl = String(options.server === true ? (process.env.PROXY_SERVER_URL || '') : (options.server || process.env.PROXY_SERVER_URL || '')).trim() || process.env.PROXY_SERVER_URL || '';
|
|
15
15
|
const shouldOpen = options.open !== false;
|
|
16
16
|
|
|
17
|
-
if (!
|
|
18
|
-
console.error('请指定上游:使用 -s/--socks <host:port>、--server <url
|
|
17
|
+
if (!options.server && !socks || !serverUrl) {
|
|
18
|
+
console.error('请指定上游:使用 -s/--socks <host:port>、--server <url>');
|
|
19
19
|
process.exit(1);
|
|
20
20
|
}
|
|
21
21
|
|