先记录,后整理
HostMachine(宿主机)
获取HostMachine IP
$ cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }'
Proxy:
PS:
代理的端口号是系统代理的端口号,同时 vpn 软件 一定要允许局域网链接.
设置代理
$ http_proxy=http://$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }'):7890
$ http_proxy=http://$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }'):7890
设置 Git 代理
$ git config --global http.https://github.com.proxy http://$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }'):7890
$ git config --global https.https://github.com.proxy http://$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }'):7890
$ git config --global http.proxy http://$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }'):7891
$ git config --global https.proxy http://$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }'):7891