Closed techiall closed 2 years ago
Windows,当前用户目录,找到 .npmrc
,删除该文件,即可恢复默认设置
Linux / macOS,rm -rf ~/.npmrc
,执行改命令即可
Windows,当前用户目录,找到 .yarnrc
,删除该文件,即可恢复默认设置
Linux / macOS,rm -rf ~/.yarnrc
,执行该命令即可
export http_proxy=http://127.0.0.1:1081
export https_prox=http://127.0.0.1:1081
Fedora DNF
参考连接:https://computingforgeeks.com/configure-system-wide-proxy-settings-on-centos-rhel-fedora/
sudo vim /etc/dnf/dnf.conf
# Add
proxy=http://127.0.0.1:1081
假设 socks 代理地址为
127.0.0.1:1080
,即socks5://127.0.0.1:1080
假设 http 代理地址为
127.0.0.1:1081
,即http://127.0.0.1:1081
Git
参考:https://gist.github.com/laispace/666dd7b27e9116faece6
但是这种方法只对 http 协议有用,对 SSH 没用。
在
~/.ssh/config
写入以下内容即可,记得安装nc
。Windows 请使用以下配置,用 git bash 打开
~/.ssh/config
,并写入以下内容Wget
参考:https://stackoverflow.com/questions/11211705/how-to-set-proxy-for-wget
在
/etc/wgetrc
或者~/.wgetrc
创建一个文件,并写入以下内容Gradle
参考:https://docs.gradle.org/current/userguide/build_environment.html#sec:accessing_the_web_via_a_proxy
在项目根目录,创建一个
gradle.properties
文件,写入以下内容。Maven
参考:https://maven.apache.org/guides/mini/guide-proxies.html
https://stackoverflow.com/questions/1251192/how-do-i-use-maven-through-a-proxy
maven 设置 proxy 比较麻烦,得在
~/.m2/settings.xml
里面配置,加入以下设置。NPM
yarn