终端无法使用代理
Tofloor
poster avatar
shamatea
deepin
2020-11-26 00:40
Author

electron-ssr开了,浏览器可以连上油管,终端不行,无论是pac模式还是全局模式,这怎么搞

Reply Favorite View the author
All Replies
sunlintong
deepin
2020-11-26 02:18
#1

polipo了解一下

Reply View the author
忘记、过去
Moderator
2020-11-26 04:33
#2

终端不受系统代理设置影响的,即使启动台里勾选使用代理也不行。


需要执行 sudo apt install proxychains4,然后执行 sudo dedit /etc/proxychains4.conf 修改配置文件,在结尾加上代理设置(比如 socks5 127.0.0.1 1080 或者 http 127.0.0.1 12333,这两个我记得是默认端口来着)。然后终端指令需要用到代理时,在命令前加上 proxychains 即可。

Reply View the author
shamatea
deepin
2020-11-30 23:26
#3
sunlintong

polipo了解一下

这样配置有问题吗,还是不行

Reply View the author
shamatea
deepin
2020-11-30 23:27
#4
忘记、过去

终端不受系统代理设置影响的,即使启动台里勾选使用代理也不行。


需要执行 sudo apt install proxychains4,然后执行 sudo dedit /etc/proxychains4.conf 修改配置文件,在结尾加上代理设置(比如 socks5 127.0.0.1 1080 或者 http 127.0.0.1 12333,这两个我记得是默认端口来着)。然后终端指令需要用到代理时,在命令前加上 proxychains 即可。

试了一下,还是不行

Reply View the author
忘记、过去
Moderator
2020-12-01 05:42
#5
shamatea

试了一下,还是不行

额,两行代理只能二选一,我也不知道为啥......建议留 socks5

Reply View the author
sunlintong
deepin
2020-12-01 16:29
#6

这是我的配置

cat /etc/polipo/config 
# This file only needs to list configuration variables that deviate
# from the default values. See /usr/share/doc/polipo/examples/config.sample
# and "polipo -v" for variables you can tweak and further information.

logSyslog = true
logFile = /var/log/polipo/polipo.log

socksParentProxy = "localhost:1080"
socksProxyType = socks5

配置之后重启polipo,再在终端引入环境变量,就行了

export http_proxy=http://127.0.0.1:8123
export https_proxy=http://127.0.0.1:8123


Reply View the author
shamatea
deepin
2020-12-01 18:38
#7

感谢两位的帮助[yeah]

Reply View the author