Skip to content

Mac 命令行翻墙 #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
felix-cao opened this issue Oct 11, 2018 · 6 comments
Open

Mac 命令行翻墙 #81

felix-cao opened this issue Oct 11, 2018 · 6 comments

Comments

@felix-cao
Copy link
Owner

felix-cao commented Oct 11, 2018

在处理 react-native 开发进行Xcode打包时,出现 Error installing FBAudienceNetwork 错误,根据错误提示,我们应该清楚命令行也是要翻墙的,本文旨在处理 Mac 电脑下的命令行翻墙!代理、翻墙的原理介绍 请移步 Shadowsocks与git的代理设置

确定命令行端口

curl 命令行翻墙配置

vi ~/.bash_profile
# my proxy
alias proxy='export http_proxy=127.0.0.1:1081;export https_proxy=$http_proxy' 
alias proxyOff='unset http_proxy;unset https_proxy'

配置生效

$ source ~/.bash_profile
$ proxy
$ echo $http_proxy
$ curl -I https://google.com

配置 Git 代理

查看代理命令

git config --global --list
或
git config --global http.proxy
git config --global https.proxy

设置代理

git config --global http.proxy http://127.0.0.1:1081
git config --global https.proxy https://127.0.0.1:1081
# 或(带用户密码)
git config --global http.proxy http://user:password@proxyhost:port
git config --global https.proxy https://user:password@proxyhost:port

取消代理

git config --global --unset http.proxy
git config --global --unset https.proxy

配置 npm 代理

npm config set proxy http://localhost:8080/
npm config set https-proxy http://localhost:8080/
npm config set strict-ssl false

取消代理

npm config delete proxy
npm config delete https-proxy

Reference

@317482454
Copy link

头疼的问题,我已经尝试了,还是无法正确下载,使用openvpn也是一样的

@felix-cao
Copy link
Owner Author

头疼的问题,我已经尝试了,还是无法正确下载,使用openvpn也是一样的

提示什么?

@psygames
Copy link

psygames commented Apr 15, 2020

因为 .bash_profile 只对当前终端有效,如果是程序调用终端则proxy并不会生效。建议在.bashrc 文件下配置:proxy (启动)

@psygames
Copy link

Unity环境下,即使配置.bashrc 仍然不能下载某些 cocoapods 源,比如facebook,建议使用vpn,或者关闭iOS Resolver gen podfiles,然后修改facebook 源(~/.cocoapods/repos/Specs/2/1/5/FBAduienceNetwork/x.x.x/podspec.json) source 改为 git:l本地地址(仅针对Unity)

@GITHUB243884919
Copy link

在处理 react-native 开发进行Xcode打包时,出现 Error installing FBAudienceNetwork 错误,根据错误提示,我们应该清楚命令行也是要翻墙的,本文旨在处理 Mac 电脑下的命令行翻墙!代理、翻墙的原理介绍 请移步 Shadowsocks与git的代理设置

确定命令行端口

curl 命令行翻墙配置

vi ~/.bash_profile
# my proxy
alias proxy='export http_proxy=127.0.0.1:1081;export https_proxy=$http_proxy' 
alias proxyOff='unset http_proxy;unset https_proxy'

配置生效

$ source ~/.bash_profile
$ proxy
$ echo $http_proxy
$ curl -I https://google.com

配置 Git 代理

查看代理命令

git config --global --list
或
git config --global http.proxy
git config --global https.proxy

设置代理

git config --global http.proxy http://127.0.0.1:1081
git config --global https.proxy https://127.0.0.1:1081
# 或(带用户密码)
git config --global http.proxy http://user:password@proxyhost:port
git config --global https.proxy https://user:password@proxyhost:port

取消代理

git config --global --unset http.proxy
git config --global --unset https.proxy

Reference

请问第一个截图:确定命令行端口。mac里从哪里打开? 谢谢~ 遇到同样的问题,也是用暗影翻墙,

@top-comengineer
Copy link

Hello. @felix-cao .
I read your post carefully.
I face the same error that you posted in the past.
expo/expo#2392
Please help me.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants