Are pip and git too slow? A tutorial for configuring Linux terminal proxy
Foreword Development nowadays heavily relies on the internet, but unfortunately, many tools are from abroad, and the access speed is too slow domestically. Therefore, configuring terminal proxies becomes essential. Introduction to ProxyChains ProxyChains is a command-line preloader that hooks into sockets in dynamically linked programs and redirects them through one or more SOCKS/HTTP proxies. GitHub address: https://github.com/rofl0r/proxychains-ng Supports MacOS and Linux.
目录10 个章节
Preface
Development nowadays is heavily dependent on the internet, but unfortunately, many tools are developed abroad, and the access speed from within China is too slow. Therefore, configuring a terminal proxy (终端代理) is quite necessary.
ProxyChains Introduction
ProxyChains is a command-line preloader that hooks into sockets in dynamically linked programs and redirects them through one or more SOCKS/HTTP proxies.
GitHub address https://github.com/rofl0r/proxychains-ng
On macOS and Linux systems, after setting up a Shadowsocks proxy, the PAC (Proxy Auto-Configuration) list can identify the domain names to be proxied. However, this requires the proxy application to support SOCKS5. If it doesn't support SOCKS5, there's no way to proxy it through Shadowsocks. Our Shell console environment does not support SOCKS proxy; it only supports HTTP proxy. If we don't set the http_proxy environment variable in the terminal, our Shell console will not be able to use the Shadowsocks proxy.
Setting http_proxy in Terminal
If you don't mind the extra steps, you can convert a SOCK proxy into an HTTP proxy by setting http_proxy in the terminal. This way, your Shell environment can indirectly use the Shadowsocks proxy as well.
export http_proxy='http://localhost:8888'
export https_proxy='http://localhost:8888'
To disable the proxy:
unset http_proxy
unset https_proxy
If you're interested, you can also add these commands to your .bashrc or .zshrc file to make it more convenient to enable the proxy globally for your Shell console.
Installing Proxychains
Open the terminal and enter the following commands.
git clone https://github.com/rofl0r/proxychains-ng.git
cd proxychains-ng
./configure
make && make install
Configuration Parameters
Modify the configuration in /usr/local/etc/proxychains.conf.
Note: Linux systems do not generate a conf file by default. You need to copy the configuration from ./src/proxychains.conf in the cloned repository to the target directory, or create it manually—both approaches are equivalent.
If the proxychain4 command does not manually specify the configuration file path, it will automatically search for it.
[ProxyList]
Add Proxy Here ...
Meanwhile
defaults set to "tor"
socks4 127.0.0.1 9050
socks5 127.0.0.1 1080 # Set your own proxy address and port here
Generally, it's 1080
## Testing
After `proxychains4` is configured, we can use it in the terminal by adding the command to proxy in the terminal. But does it really proxy everything??? The answer is that it doesn't work on MacOS, while Linux users are already fine.
proxychains4 curl -L tool.lu/ip
The result is shown below:

## Chat With Me
- Live Coding Stream: [https://live.bilibili.com/11883038](https://live.bilibili.com/11883038)
- WeChat Official Account: DealiAxy
- Zhihu: [https://www.zhihu.com/people/dealiaxy](https://www.zhihu.com/people/dealiaxy)
- Blog: [https://blog.deali.cn](https://blog.deali.cn)
- Jianshu: [https://www.jianshu.com/u/965b95853b9f](https://www.jianshu.com/u/965b95853b9f)
_EOF_
Are pip and git too slow? A tutorial for configuring Linux terminal proxy
- 本文作者:
- 程序设计实验室
- 版权声明:
- 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
相关文章
Manjaro-Linux安装Virtualbox的那些坑与解决方案~
前言 不久之前,由于我的Ubuntu安装盘空间满了,于是想在新的SSD上装另一个系统,于是就又回到了Manjaro的怀抱,KDE桌面真好用,不过很多配置的地方还是要研究一下的,毕竟以前主要用的桌面还是Gtk系的~ 进入正题 安装virtualbox Manjaro的官方源里面是有virtualbox的,直接打开Octopi搜一下就有了~ 或者输入命令安装: sudo pacman -S virtu
2025-10-27 · FAQ & Tips · 约 1 分钟
How-to-change-mouse-cursor-and-theme-
In order to get your custom cursor to work with all applications do: Download a cursor theme. Extract it to /usr/share/icons or ~/.local/share/icons Open Gnome Tweak Tool and change the cursor theme.
2025-10-27 · FAQ & Tips · 约 1 分钟
Linux下查看dd命令写入进度
前言 Linux下有一个强力工具,dd,用来操作镜像,简直神器,唯一的不足是没有显示操作进度,不过也不是没有办法,下面介绍几个查看写入进度的方法。 status选项查看进度 如果你使用的是GNU版本的dd,并且coreutils版本高于8.24,那么可以使用status选项。例如: sudo dd if=/dev/sda of=/dev/zero status=progress 上面命令在Mac
2025-10-27 · FAQ & Tips · 约 1 分钟
Debian系Linux:获取指定应用的快捷方式文件地址
快捷方式 就是 *.desktop 文件咯 dpkg -L application-name | grep desktop
2025-10-27 · FAQ & Tips · 约 1 分钟
讨论
共 0 条加载评论中…