✨ Support setting proxy URL
This commit is contained in:
5
bin/README.md
vendored
5
bin/README.md
vendored
@@ -259,10 +259,11 @@ Supports both comma-separated and multiple option formats:
|
||||
|
||||
#### [proxy-url]
|
||||
|
||||
If you need to proxy requests for some reason, you can set the proxy address using the `proxy-url` option.
|
||||
Set proxy server for all network requests. Supports HTTP, HTTPS, and SOCKS5.
|
||||
|
||||
```shell
|
||||
--proxy-url <url>
|
||||
--proxy-url http://127.0.0.1:7890
|
||||
--proxy-url socks5://127.0.0.1:7891
|
||||
```
|
||||
|
||||
#### [debug]
|
||||
|
||||
5
bin/README_CN.md
vendored
5
bin/README_CN.md
vendored
@@ -261,10 +261,11 @@ pake [url] [options]
|
||||
|
||||
#### [proxy-url]
|
||||
|
||||
假如你由于某些缘故需要代理请求,你可以通过 `proxy-url` 选项来设置代理地址。
|
||||
为所有网络请求设置代理服务器。支持 HTTP、HTTPS 和 SOCKS5。
|
||||
|
||||
```shell
|
||||
--proxy-url <url>
|
||||
--proxy-url http://127.0.0.1:7890
|
||||
--proxy-url socks5://127.0.0.1:7891
|
||||
```
|
||||
|
||||
#### [debug]
|
||||
|
||||
2
bin/cli.ts
vendored
2
bin/cli.ts
vendored
@@ -68,7 +68,7 @@ program
|
||||
)
|
||||
.option('--debug', 'Debug build and more output', DEFAULT.debug)
|
||||
.addOption(
|
||||
new Option('--proxy-url <url>', 'Proxy URL for all network requests')
|
||||
new Option('--proxy-url <url>', 'Proxy URL for all network requests (http://, https://, socks5://)')
|
||||
.default(DEFAULT_PAKE_OPTIONS.proxyUrl)
|
||||
.hideHelp(),
|
||||
)
|
||||
|
||||
2
bin/options/index.ts
vendored
2
bin/options/index.ts
vendored
@@ -20,6 +20,7 @@ function isValidName(name: string, platform: NodeJS.Platform): boolean {
|
||||
return !!name && reg.test(name);
|
||||
}
|
||||
|
||||
|
||||
export default async function handleOptions(
|
||||
options: PakeCliOptions,
|
||||
url: string,
|
||||
@@ -56,6 +57,7 @@ export default async function handleOptions(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const appOptions: PakeAppOptions = {
|
||||
...options,
|
||||
name,
|
||||
|
||||
Reference in New Issue
Block a user