Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux终端如何走SSR代理 #164

Open
itgoyo opened this issue Jun 14, 2019 · 1 comment
Open

linux终端如何走SSR代理 #164

itgoyo opened this issue Jun 14, 2019 · 1 comment

Comments

@itgoyo
Copy link
Owner

itgoyo commented Jun 14, 2019

打开electron-ssr的配置选项查看http代理的端口号是多少

  • 方法一
在终端中直接运行:

export http_proxy=http://proxyAddress:port

如果你是SSR,并且走的http的代理端口是12333,想执行wget或者curl来下载国外的东西,可以使用如下命令:

export http_proxy=http://127.0.0.1:12333

如果是https那么就经过如下命令:

export https_proxy=http://127.0.0.1:12333
  • 方法二
     这个办法的好处是把代理服务器永久保存了,下次就可以直接用了

把代理服务器地址写入shell配置文件.bashrc或者.zshrc 直接在.bashrc或者.zshrc添加下面内容

export http_proxy="http://localhost:port"
export https_proxy="http://localhost:port"

或者走socket5协议(ss,ssr)的话,代理端口是1080

export http_proxy="socks5://127.0.0.1:1080"
export https_proxy="socks5://127.0.0.1:1080"

或者干脆直接设置ALL_PROXY

export ALL_PROXY=socks5://127.0.0.1:1080

最后在执行如下命令应用设置

source ~/.bashrc

或者通过设置alias简写来简化操作,每次要用的时候输入setproxy,不用了就unsetproxy。

 alias setproxy="export ALL_PROXY=socks5://127.0.0.1:1080" alias alias unsetproxy="unset ALL_P
  • 方法三
改相应工具的配置,比如apt的配置

sudo vim /etc/apt/apt.conf

在文件末尾加入下面这行

Acquire::http::Proxy "http://proxyAddress:port"
@WeiSQ-zju
Copy link

感谢感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants