【已解决】Deepin V20终端代理使用
Tofloor
poster avatar
风吹过的绿洲
deepin
2020-07-12 00:08
Author
本帖最后由 as763190097 于 2020-7-13 12:42 编辑

浏览器用SwitchyOmega插件,很好用。但是系统代理手动代理都搞不了





该怎么玩的呢?


终端代理解决方案见 7 8 11楼
Reply Favorite View the author
All Replies
avatar
残念
deepin
2020-07-12 00:57
#1
如果终端使用代理推荐使用proxychains
Reply View the author
avatar
Ziggy
deepin
2020-07-12 01:18
#2
你有代理工具和服务器没
Reply View the author
avatar
风吹过的绿洲
deepin
2020-07-12 01:42
#3
https://bbs.deepin.org/post/197020
你有代理工具和服务器没

浏览器能用,肯定有啊
Reply View the author
avatar
风吹过的绿洲
deepin
2020-07-12 01:45
#4
https://bbs.deepin.org/post/197020
如果终端使用代理推荐使用proxychains

你们系统自带的功能能能使用吗?
Reply View the author
avatar
残念
deepin
2020-07-12 01:47
#5
https://bbs.deepin.org/post/197020
你们系统自带的功能能能使用吗?

什么功能?应用代理?
Reply View the author
avatar
jerry979
deepin
2020-07-12 02:14
#6
本帖最后由 jerry979 于 2020-7-11 18:16 编辑

应用代理的确有bug, 有的时候用不了. 但终端代理不是你那样用的

export http_proxy=http://xxx.xxx.xxx.xxx:xxxx
export https_proxy=http://xxx.xxx.xxx.xxx:xxxx

设置快捷键更方便, 或者把上面的命令加入 ~/.bashrc .

而且ping貌似是不走代理的
Reply View the author
avatar
忘记、过去
deepin
2020-07-12 02:34
#7
终端代理一般是在.zshrc之类的里面直接export http_proxy=xxxx,也可以写
  1. function setproxy() {
  2.     export http_proxy="xxxx"
  3.     export https_proxy="xxxx"
  4.     export ftp_proxy="xxxx"
  5. }

  6. function unsetproxy() {
  7.     unset http_proxy
  8.     unset https_proxy
  9.     unset ftp_proxy
  10. }
Copy the Code

这样来设置一个方法,需要的时候执行setproxy就能启用终端代理。关闭终端后就失效了。
Reply View the author
avatar
风吹过的绿洲
deepin
2020-07-12 04:34
#8
https://bbs.deepin.org/post/197020
应用代理的确有bug, 有的时候用不了. 但终端代理不是你那样用的

export http_proxy=http://xxx.xxx.xxx.xx ...

这个我之前试过了,mac下可用,deepin用不了。。。。。。



Reply View the author
avatar
Feng Yu
deepin
2020-07-12 05:13
#9
本帖最后由 abcfy2 于 2020-7-11 21:18 编辑

那个系统代理其实是图形界面下的使用系统网络调用的时候会使用的代理,对于终端程序都是无效的。如果你期望对整个系统有效,那么应该走透明代理,比较麻烦,需要你懂iptables,以及比较深刻的网络知识,至少CCNA级别

ping命令默认使用的是ICMP协议,你设置http proxy当然没用。你要想测试代理用curl是可以的,那个用的是http协议
https://superuser.com/questions/175428/how-to-ping-when-behind-a-proxy
Reply View the author
avatar
风吹过的绿洲
deepin
2020-07-12 06:20
#10
https://bbs.deepin.org/user/220808  https://bbs.deepin.org/user/154730  https://bbs.deepin.org/user/13508   感谢三位大佬,搞定了。确实不能用ping来验证,然后终端不支持SOCKS5代理,改成http,用curl验证没问题的。

  1. jay@jay-PC:~$ curl -I www.google.com.hk
  2. HTTP/1.1 200 OK
  3. content-type: text/html; charset=Big5
  4. p3p: CP="This is not a P3P policy! See g.co/p3phelp for more info."
  5. date: Sat, 11 Jul 2020 14:17:27 GMT
  6. server: gws
  7. x-xss-protection: 0
  8. x-frame-options: SAMEORIGIN
  9. set-cookie: 1P_JAR=2020-07-11-14; expires=Mon, 10-Aug-2020 14:17:27 GMT; path=/; domain=.google.com.hk; Secure
  10. set-cookie: NID=204=YdL0IHpyhJdtAP10egWU806eR7oGP4TLBVJdo1WVoV9jOMvYiRiFjUtjKKZ4EzyCD_8tprmMRPYQoDez36iZ-0Ij_AwXP4kmm-W0kd3h0gT06iwFbg9Szvb_yVE7m9JHXeSPhIj8GHxdLjzHe8GUAiDUW_UkHhNeLr25FR9GCCo; expires=Sun, 10-Jan-2021 14:17:27 GMT; path=/; domain=.google.com.hk; HttpOnly
  11. expires: Sat, 11 Jul 2020 14:17:27 GMT
  12. cache-control: private
  13. content-length: 0
Copy the Code
Reply View the author
avatar
小小怪下士
deepin
2020-10-06 01:09
#11
https://bbs.deepin.org/post/197020
终端代理一般是在.zshrc之类的里面直接export http_proxy=xxxx,也可以写

这样来设置一个方法,需要的时候 ...

大佬,这个是直接写一个.zshrc,还是什么呀,还有账号密码怎么输入的
Reply View the author
avatar
sevenfal
deepin
2020-10-06 04:07
#12
直接 export ALL_PROXY=
Reply View the author
avatar
lanyun7112
deepin
2020-10-06 04:51
#13
https://bbs.deepin.org/post/197020
终端代理一般是在.zshrc之类的里面直接export http_proxy=xxxx,也可以写

这样来设置一个方法,需要的时候 ...

厉害,不过测试了一下,关闭终端并不能自动关闭代理,要执行unsetproxy才能,另外socks5是否可以这样设置export ALL_PROXY=socks5://xxxx
Reply View the author