本文基于
声明
坚决拥护党的领导,本文章所用技术乃出于工作需要,敬请谅解。
正文
可以先过去快速浏览一遍再回头看本文章。上文有一处配置需要注意和容易迷惑的地方。在这里踩坑花了一下午。。。
即:要注意自己使用的Shadow socks或其他代理(vTworay等)端口为是否为1080。如果不是,需要修改为相关端口。否则在进行命令行操作时,会提示连接到127.0.0.1:1080失败 。
Failed to connect to 127.0.0.1 port 1080: Connection refused
查看Shadow socks代理端口方法如下:
多次失败截图:
代理后看到的希望:
成功截图:
补充
vTworay更好用
在发布sdk到cocoapods时,用Shadow socks代理时会出现YYModel更新失败,但是用vTworay就能够成功!
socks5原理
https://baike.baidu.com/item/socks5
https://zhuanlan.zhihu.com/p/28645864
代理扩展用法
- If you do not want to set the proxy as global config,try ALL_PROXY= e.g.:
ALL_PROXY=socks5://127.0.0.1:xx git clone https://github.com/some/one.git
- (Just a little reminder) If you want the hostname also be resolved by the proxy (that means passing everything through the proxy),especially when you are cloning a gist,you can use the following setting (the key is that it uses socks5h instead of socks5):
git config --global http.proxy socks5h://127.0.0.1:xx
https://stackoverflow.com/questions/15227130/using-a-socks-proxy-with-git-for-the-http-transport#
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。