http代理
socks代理的话,把http换成socks或者socks5就可以了
1 2 3 sudo apt search proxychains sudo apt install xxx vim /etc/proxychains.conf # 修改配置文件,设置代理
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 # 设置 export http_proxy=ip:port export https_proxy=ip:port # export http_proxy=http://userName:password@proxyAddress:port export https_proxy=http://userName:password@proxyAddress:port # 取消设置 unset http_proxy # unset https_proxy # 永久加入 # vim ~/.bashrc
git代理
1 2 3 4 5 6 git config --global user.name "blingxxxxuanxxx" git config --global user.email "xxx@163.com" ssh-keygen -t rsa -b 4096 -C "xxx@163.com" git config --global http.proxy http://用户名:密码@ip:port git config --global https.proxy http://用户名:密码@ip:port git config --global http.sslVerify false
1 2 git config --global http.proxy http://ip:port git config --global https.proxy http://ip:port
1 2 git config --global --get http.proxy git config --global --get https.proxy
1 2 git config --global --unset http.proxy git config --global --unset https.proxy
pip 代理
使用 --proxy=代理服务器IP:端口
的方式:
1 sudo /usr/bin/python3.6 -m pip --proxy=http://192.168.56.1:808 install --target /usr/local/lib/python3.6/dist-packages -Ur requirements.txt
gem 代理
找到gem文件位置,打开gem文件,在begin下添加args并配置代理:
1 2 3 4 5 6 7 8 9 bling@Ubuntu2004:~$ which gem /usr/bin/gem bling@Ubuntu2004:~$ vim /usr/bin/gem begin args += ['--http-proxy','http://x.x.x.x:port'] # 添加这一句 Gem::GemRunner.new.run args rescue Gem::SystemExitException => e exit e.exit_code end