ubutun终端设置代理记录

前提

安装并,配置好shadowsocks

在这里插入图片描述

设置系统代理

进入系统设置,这里跟终端没有什么关系。
在这里插入图片描述
这里要查看shadowsocks设置:
在这里插入图片描述
然后将系统代理设置为如下:
在这里插入图片描述

设置终端代理

当前终端有效
export https_proxy="https://127.0.0.1:1080"
export http_proxy="http://127.0.0.1:1080"
export ALL_PROXY=socks5://127.0.0.1:1080

为了使得全局有效,将其添加到bashrc

sudo gedit ~/.bashrc
export https_proxy="https://127.0.0.1:1080"
export http_proxy="http://127.0.0.1:1080"
export ALL_PROXY=socks5://127.0.0.1:1080
然后使得其生效:
source ~/.bashrc

测试

wget https://www.google.com
--2021-06-06 15:08:05--  https://www.google.com/
Connecting to 127.0.0.1:1080... connected.
Proxy request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html.1’

index.html.1             [ <=>                   ]  13.79K  --.-KB/s    in 0s      

2021-06-06 15:08:06 (102 MB/s) - ‘index.html.1’ saved [14122]

在这里要注意要将shadowsocks设置为https,本应该socks5就可以的才对,这是有点不理解的地方

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_42263796/article/details/117627146
今日推荐