FUCK-GFW

Windows 万能命令

CMD

1
set http_proxy=http://127.0.0.1:7890 & set https_proxy=http://127.0.0.1:7890

Powershell

1
$Env:http_proxy="http://127.0.0.1:7890";$Env:https_proxy="http://127.0.0.1:7890"

Linux 万能命令

wget

1
2
3
4
# http
wget http://github.com/coder/code-server/releases/download/v4.8.0/code-server_4.8.0_amd64.deb -e use_proxy=yes -e http_proxy=192.168.3.126:10811
# https
wget https://github.com/coder/code-server/releases/download/v4.8.0/code-server_4.8.0_amd64.deb -e use_proxy=yes -e https_proxy=192.168.3.126:10811

shell

1
2
3
4
5
6
7
# 在终端中导出以下变量
export http_proxy="http://192.168.0.103:7890"
export https_proxy="http://192.168.0.103:7890"

# 并使用以下命令禁用代理
unset http_proxy
unset https_proxy

通用解释:

~ 代表用户目录
查看方法

1
echo %USERPROFILE%
1
2
cd ~
pwd

pip

https://developer.aliyun.com/mirror/pypi > https://mirrors.huaweicloud.com/home

Pip 的配置文件为用户根目录下的:~/.pip/pip.conf(Windows 路径为:C:\Users<UserName>\pip\pip.ini), 您可以配置如下内容:

1
2
3
4
5
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com
1
2
[global]
proxy = http://127.0.0.1:7890
1
pip install ??? --proxy=代理服务器IP:端口号

git

~/.gitconfig

1
2
3
4
[http]
proxy = http://127.0.0.1:7890
[https]
proxy = https://127.0.0.1:7890
1
2
3
4
5
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:7890

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

Gradle

https://developer.aliyun.com/mirror/maven

在 build.gradle 文件中加入以下代码:

1
2
3
4
5
6
7
allprojects {
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
mavenLocal()
mavenCentral()
}
}

~/.gradle/gradle.properties

1
2
3
4
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=7890
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=7890

Maven

https://developer.aliyun.com/mirror/maven > https://mirrors.huaweicloud.com/home

~/.m2/settings.xml
<Maven 安装目录>/conf/settings.xml

1
2
3
4
5
6
7
8
9
10
11
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
<mirror>
<id>huaweicloud</id>
<mirrorOf>*</mirrorOf>
<url>https://repo.huaweicloud.com/repository/maven/</url>
</mirror>

npm

https://www.npmmirror.com/

1
npm install -g cnpm --registry=https://registry.npmmirror.com
1
2
3
4
npm config set proxy http://127.0.0.1:7890
npm config set https-proxy http://127.0.0.1:7890
npm config delete proxy
npm config delete https-proxy

yarn

1
2
yarn config set proxy http://127.0.0.1:7890
yarn config set https-proxy http://127.0.0.1:7890

wget

1
2
use_proxy=yes http_proxy=127.0.0.1:7890 https_proxy=127.0.0.1:7890
~/.wgetrc

snap

1
2
sudo snap set system proxy.http="http://127.0.0.1:7890"
sudo snap set system proxy.https="http://127.0.0.1:7890"

docker

https://help.aliyun.com/document_detail/60750.html


FUCK-GFW
https://blog.josway.cc/2022/05/08/yuque/FUCK-GFW/
作者
JOSWAY
发布于
2022年5月8日
许可协议