Skip to content

Commit

Permalink
Create 2024-09-29-proxy-shell.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Cheng authored Sep 29, 2024
1 parent 2a64939 commit eae0c73
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions _posts/2024-09-29-proxy-shell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 使用proxy

假设代理服务器安装在本机127.0.0.1的地址上,在~/.profile中添加如下代码。

```shell
function proxy() {
hostip=$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }')
#hostip=127.0.0.1
ALL_PROXY=socks5://$hostip:10808 $@
#https_proxy=http://$hostip:10809 http_proxy=http://$hostip:10809 $@
echo $ALL_PROXY
}
```

如果使用代理服务器访问外网,用`proxy`开头后面跟命令,例如:
```
proxy git submodule update --init --recursive
```

0 comments on commit eae0c73

Please sign in to comment.