itgoyo / 500Days-Of-Github

⭐ 瞎JB折腾Mac/Linux/Windows过程中遇到的所有问题和解决方式 ⭐

Home Page:https://itgoyo.github.io/500Days-Of-Github

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

linux终端如何走SSR代理

itgoyo opened this issue · comments

打开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"

感谢感谢