Add tokyo-proxy: 东京服务器代理 GitHub + Docker 流量转发

This commit is contained in:
hermes-bot
2026-05-30 01:57:31 +00:00
parent 9fd51e7556
commit c09b23df6e
2 changed files with 91 additions and 6 deletions

View File

@@ -0,0 +1,83 @@
# 东京云服务器代理方案
## 场景
国内访问 GitHub / Docker Hub 速度慢,用东京低配云服务器做流量转发。
## 服务端(东京服务器)
### 1. 安装 squid
```bash
apt update && apt install -y squid apache2-utils
```
### 2. 配置 squid密码认证
```bash
cat > /etc/squid/squid.conf << 'EOF'
http_port 3128
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic realm "Tokyo Proxy"
acl auth proxy_auth REQUIRED
http_access allow auth
http_access deny all
EOF
```
### 3. 创建用户
```bash
htpasswd -cb /etc/squid/passwd 用户名 密码
```
### 4. 重启
```bash
systemctl restart squid
systemctl enable squid
```
### 验证
```bash
ss -tlnp | grep 3128
```
---
## 国内客户端
### Docker 配置
```bash
mkdir -p /etc/systemd/system/docker.service.d
cat > /etc/systemd/system/docker.service.d/http-proxy.conf <<EOF
[Service]
Environment="HTTP_PROXY=http://用户名:密码@东京服务器IP:3128"
Environment="HTTPS_PROXY=http://用户名:密码@东京服务器IP:3128"
EOF
systemctl daemon-reload && systemctl restart docker
```
### Git 配置
```bash
git config --global http.proxy http://用户名:密码@东京服务器IP:3128
git config --global https.proxy http://用户名:密码@东京服务器IP:3128
```
### 取消代理(如需直连)
```bash
git config --global --unset http.proxy
git config --global --unset https.proxy
# Docker 删除 /etc/systemd/system/docker.service.d/http-proxy.conf 后重启
```
---
## 验证
```bash
docker pull nginx
git clone https://github.com/torvalds/linux
```
---
## 注意事项
- 东京服务器带宽低1-2MbpsDocker 拉大镜像较慢
- Git 流量小,代理无压力
- HTTP 代理同时支持 Git 和 Docker无需 nginx 反代

View File

@@ -6,12 +6,14 @@
``` ```
AI/ AI/
── mem0/ # Mem0 自托管部署、架构、运维知识 ── mem0/ # Mem0 自托管部署、架构、运维知识
├── 01-basics.md ├── 01-basics.md
├── 02-architecture.md ├── 02-architecture.md
├── 03-deployment.md ├── 03-deployment.md
├── 04-your-infra.md ├── 04-your-infra.md
└── 05-faq.md └── 05-faq.md
└── tokyo-proxy/ # 东京云服务器代理GitHub + Docker 流量转发
└── 01-proxy.md
``` ```
## 来源 ## 来源