Skip to content

Commit b7e79de

Browse files
authored
Merge pull request #2592 from shamiao/master
add PowerShell to proxies docs.
2 parents 3df2264 + fd46e25 commit b7e79de

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

doc/src/network-proxies.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,23 @@
33
Enterprise networks often don't have direct outside HTTP access, but enforce
44
the use of proxies. If you're on such a network, you can request that `rustup`
55
uses a proxy by setting its URL in the environment. In most cases, setting
6-
`https_proxy` should be sufficient. On a Unix-like system with a shell like
7-
__bash__ or __zsh__, you could use:
8-
9-
```bash
10-
export https_proxy=socks5://proxy.example.com:1080 # or http://proxy.example.com:8080
11-
```
12-
13-
On Windows, the command would be:
14-
15-
```cmd
16-
set https_proxy=socks5://proxy.example.com:1080
17-
```
6+
`https_proxy` should be sufficient. Commands may differ between different
7+
systems and shells:
8+
9+
- On a Unix-like system with a shell like __bash__ or __zsh__:
10+
```bash
11+
export https_proxy=socks5://proxy.example.com:1080
12+
```
13+
- On Windows [__Command Prompt (cmd)__][cmd]:
14+
```cmd
15+
set https_proxy=socks5://proxy.example.com:1080
16+
```
17+
- On Windows [__PowerShell__][ps] (or __PowerShell Core__):
18+
```cmd
19+
$env:https_proxy="socks5://proxy.example.com:1080"
20+
```
21+
- Replace `socks5://proxy.example.com:1080` with
22+
`http://proxy.example.com:8080` when an HTTP proxy is used instead.
1823

1924
If you need a more complex setup, `rustup` supports the convention used by the
2025
__curl__ program, documented in the ENVIRONMENT section of [its manual
@@ -34,3 +39,5 @@ getting an SSL `unknown protocol` error from `rustup` via `libcurl` but the
3439
command-line `curl` command works fine, this may be the problem.
3540

3641
[curlman]: https://curl.haxx.se/docs/manpage.html
42+
[cmd]: https://en.wikipedia.org/wiki/Cmd.exe
43+
[ps]: https://en.wikipedia.org/wiki/PowerShell

0 commit comments

Comments
 (0)