FUCK-GFW - 记录四パッケージ管理器使用代理的方法、因是GFW已经浪费了已经数不清的時間、FUCK GFW

(记录各个包管理器使用代理的方法, 因为GFW已经浪费了已经数不清的时间, FUCK GFW)

Created at: 2018-04-13 18:50:33
Language:

FUCK-GFW

二度とGFWで時間を無駄にしたくありません。

如果你的包管理器想帰使用される秀的镜像仓库、请適

目录

ピップ

〜/ .config / pip / pip.conf

[global]
proxy=http://localhost:1087

不注意ソックス5

参照

ギット

sshでクローンする

在文件后

~/.ssh/config
四行两行

Host github.com
# Mac下
ProxyCommand nc -X 5 -x 127.0.0.1:1080 %h %p
# Linux下
ProxyCommand nc --proxy-type socks5 --proxy 127.0.0.1:1080 %h %p

注Linux和Mac下ncat/netcat区4、详见https://unix.stackexchange.com/questions/368155/what-are-the-differences-between-ncat-nc-and-netcat

httpでクローンする

git config --global http.proxy http://127.0.0.1:1087

建议使用http、因是socks5在使用git-lfs時会报错

proxyconnect tcp: dial tcp: lookup socks5: no such host

参照

https://gist.github.com/laispace/666dd7b27e9116faece6

貨物

貨物会依次检查

  1. 循環変数
    CARGO_HTTP_PROXY
export CARGO_HTTP_PROXY=http://127.0.0.1:1080
  1. config.toml
    _
    http.proxy
[http]
proxy = "127.0.0.1:1080"
  1. 循環
    HTTPS_PROXY
    変数量&&
    https_proxy
    http_proxy
export https_proxy=http://127.0.0.1:1080
export http_proxy=http://127.0.0.1:1080

http_proxy
普通来讲没Ph、非非使用基にHTTP的クレートリポジトリ

貨物使用libcurl、故可接受任何符合libcurlformat的地址与协议

127.0.0.1:1080
、、
http://127.0.0.1:1080
socks5://127.0.0.1:1080
均可

参照

https://doc.rust-lang.org/cargo/reference/config.html#httpproxy

apt(apt-get)

/etc/apt/apt.conf.d/
目录下新增文件
proxy.conf
、化:

Acquire::http::Proxy "http://127.0.0.1:8080/";
Acquire::https::Proxy "http://127.0.0.1:8080/";

適合:無法使用Socks5代。

参照

https://askubuntu.com/a/349765/883355

カール

socks5 = "127.0.0.1:1080"

追加

~/.curlrc

参照

https://www.zhihu.com/question/31360766

Gradle

この浪费了好86時間额〜/ .gradle / gradle.properties

systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=1087
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=1087

参照

https://stackoverflow.com/questions/5991194/gradle-proxy-configuration

Maven

%Maven安装目录%/ conf / settings.xml

  <!-- proxies
   | This is a list of proxies which can be used on this machine to connect to the network.
   | Unless otherwise specified (by system property or command-line switch), the first proxy
   | specification in this list marked as active will be used.
   |-->
  <proxies>
    <!-- proxy
     | Specification for one proxy, to be used in connecting to the network.
     |
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>proxy.host.net</host>
      <port>80</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
    -->
     <proxy>
      <id>proxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>127.0.0.1</host>
      <port>1087</port>
    </proxy>
  </proxies>

参照

https://maven.apache.org/guides/mini/guide-proxies.html

取ってきます

HTTP_PROXY=socks5://localhost:1080 go get

⯕了下HTTPS_PROXY和ALL_PROXY都不起作用

またはUsegoproxy.io

npm

npm config set proxy http://127.0.0.1:1087
npm config set https-proxy http://127.0.0.1:1087

用ソックス5就报错--

推荐用毛糸、npm是真的頂

参照

錆びた

export https_proxy=http://127.0.0.1:1080

废物中国電信、不挂差かつ如龟

yarn config set proxy http://127.0.0.1:1087
yarn config set https-proxy http://127.0.0.1:1087

不用ソックス5

参照

https://github.com/yarnpkg/yarn/issues/3418

糸2

糸2+-公式

yarn config set httpProxy http://127.0.0.1:1087
yarn config set httpsProxy http://127.0.0.1:1087

不回答
全局

入力:これらの命令会修改项目目录下的

.yarnrc.yml
文件、请的不要☆带有如:

httpsProxy: "socks5://127.0.0.1:1080"

代代码提交到仓库、以免造成麻烦

建议使用npm镜像不是配置使用代
yarn config set npmRegistryServer https://127.0.0.1:1087

注意:この方法不用用下5000ヤーン官方插件!
糸的官方插件默认会からGitHub(raw.githubusercontent.com

参照

宝石

〜/ .gemrc

---
# See 'gem help env' for additional options.
http_proxy: http://localhost:1087

参照

  • グーグル

醸造

ALL_PROXY=socks5://localhost:1080 brew ...

wget

use_proxy=yes
http_proxy=127.0.0.1:1087
https_proxy=127.0.0.1:1087

〜/ .wgetrc

参照

スナップ

sudo snap set system proxy.http="http://127.0.0.1:1087"
sudo snap set system proxy.https="http://127.0.0.1:1087"

参照

https://askubuntu.com/questions/764610/how-to-install-snap-packages-behind-web-proxy-on-ubuntu-16-04#answer-1146047

Docker

$ sudo mkdir -p /etc/systemd/system/docker.service.d
$ sudo vim /etc/systemd/system/docker.service.d/proxy.conf

[Service]
Environment="ALL_PROXY=socks5://localhost:1080"

$ sudo systemctl daemon-reload
$ sudo systemctl restart docker

必须是socks5、http不生化

電子開発依存性

変数と変数

ELECTRON_GET_USE_PROXY=true
GLOBAL_AGENT_HTTPS_PROXY=http://localhost:1080

参考文献

Visual Studio Code Remote(WSL2)

WSL2環境下可通過取脚本スクリプト件

~/.vscode-server/server-env-setup
、設定変数変換量、使用変数。

WSL2内循環路访问Win下的代理行端口代理(例子代码中http差端口监听17070)、因是子ر

新建

~/.vscode-server/server-env-setup
文件、これ文件会在VSCode启PINWSL環構后加
source

WSL_HOST=$(sed -n '/^nameserver/p' /etc/resolv.conf | cut -d' ' -f2)
export http_proxy=http://${WSL_HOST}:17070
export https_proxy=$http_proxy
export all_proxy=$http_proxy

参考文献

Visual Studio Code Remote(SSH)

VSCodeSSH后的インターネット不会使用本地界面VSCode内的代理設定、如果SSH主机没有默认0042络链接または在墙内、会導致问题。

SSHの主机は

需要手PINダウンロードvscode的サーバーエンドトランシーバー

SSH主机在墙内

虽然文档未提済、しかし是受使用WSL定的方案、配置

~/.vscode-server/server-env-setup
文件設定ファイル。

SSH主机有代理程序监听在17070端口:

新建

~/.vscode-server/server-env-setup
文件、これ文件会在VSCode启PINWSL環構后加ソース。

export http_proxy=http://127.0.0.1:17070
export https_proxy=$http_proxy
export all_proxy=$http_proxy

参考文献

チップ

推荐使用Clash、windows版mac版(注意:ClashX ProDTUN功能、ClashX不適用)、開启Tunモード

参照

https://docs.cfw.lbyczf.com/contents/tun.html

スクープ

scoop config proxy 127.0.0.1:1080

参照

OpenWRT opkg

在LUCI面版菜単配置または者/etc/opkg.conf

option http_proxy http://localhost:1080/

参考文献

https://openwrt.org/docs/guide-user/additional-software/opkg