小蜗熊的蜂蜜罐
Ubuntu下系统及应用的代理设置
发布于: 2017-07-09 更新于: 2021-11-19 分类于: 技术 > Linux 阅读次数: 

后端设置

安装ss-libev

1
2
sudo apt update
sudo apt install shadowsocks-libev

对于14.04和16.04需从PPA安装

1
2
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:max-c-lv/shadowsocks-libev -y

配置与启动

1
2
3
4
5
6
# 启动
sudo ss-local -c <config json path> start
# 停止
sudo ss-local -c <config json path> stop
# 重启
sudo ss-local -c <config json path> restart

可以加入服务自动启动或是用screen手动启动

Chrome浏览器代理设置

打开开发者模式,使用crx文件安装SwtichyOmega插件。

SwtichyOmega插件地址:Github release本站下载

git代理设置

1
2
3
4
5
6
7
#设置代理
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080

#删除代理
git config --global --unset http.proxy
git config --global --unset https.proxy

npm代理设置方式

设置代理

1
2
npm config set proxy socks5://127.0.0.1:1080
npm config set https-proxy socks5://127.0.0.1:1080

删除代理

1
2
npm config delete proxy
npm config delete https-proxy

设置淘宝源

1
npm config set registry https://registry.npm.taobao.org

恢复官方源

1
npm config delete registry
--- 本文结束 The End ---