- sing-box 单进程 bind 数据网卡 - mixed HTTP+SOCKS + 中文静态面板 - install.sh 支持 curl | sudo bash - 512MB 友好 MemoryMax 默认 96MB
96 lines
2.5 KiB
Markdown
96 lines
2.5 KiB
Markdown
# cellular-proxy
|
||
|
||
轻量 **「走代理 = 走数据流量」** 方案(无 frp,512MB 友好)。
|
||
|
||
## 语义(重要)
|
||
|
||
| 流量 | 出口 |
|
||
|------|------|
|
||
| **不走** 本代理 | 系统默认(通常 WiFi) |
|
||
| **走** 本代理(HTTP/SOCKS) | **一律数据网卡**(运营商流量) |
|
||
|
||
```text
|
||
客户端 → mixed:7890 → sing-box → bind_interface=数据网卡 → 运营商
|
||
系统直连 → 仍走 WiFi
|
||
```
|
||
|
||
## 一键安装
|
||
|
||
```bash
|
||
# 最简(会生成随机面板密钥;装完后请改 CELLULAR_IFACE)
|
||
curl -fsSL 'https://gitea.chickliu.fun/Hermes/cellular-proxy/raw/branch/main/install.sh' | sudo bash
|
||
|
||
# 推荐:指定数据网卡 + 面板密钥 + 代理账号
|
||
curl -fsSL 'https://gitea.chickliu.fun/Hermes/cellular-proxy/raw/branch/main/install.sh' | sudo bash -s -- \
|
||
--iface wwan0 \
|
||
--secret '你的面板密钥' \
|
||
--user proxy \
|
||
--pass '你的代理密码'
|
||
|
||
# 本地源码安装(不拉 Gitea)
|
||
sudo bash install.sh --local /path/to/cellular-proxy --iface wwan0
|
||
```
|
||
|
||
| 选项 | 说明 |
|
||
|------|------|
|
||
| `--iface` | 数据网卡名 |
|
||
| `--secret` | 面板 `PANEL_SECRET` |
|
||
| `--user` / `--pass` | 代理鉴权 |
|
||
| `--port` / `--panel-port` | 默认 7890 / 9090 |
|
||
| `--memory` | MemoryMax MB,默认 96 |
|
||
| `--skip-start` | 只装不启 |
|
||
|
||
装完验证:
|
||
|
||
```bash
|
||
sudo cpxy verify
|
||
# 期望:直连 IP(WiFi) ≠ 代理 IP(数据)
|
||
```
|
||
|
||
- 代理:`LAN-IP:7890`(HTTP + SOCKS5)
|
||
- 面板:`http://LAN-IP:9090/`
|
||
|
||
## 手动安装
|
||
|
||
```bash
|
||
git clone https://gitea.chickliu.fun/Hermes/cellular-proxy.git
|
||
cd cellular-proxy
|
||
cp config/settings.conf.example config/settings.conf
|
||
# 编辑 CELLULAR_IFACE / PANEL_SECRET / PROXY_USER / PROXY_PASS
|
||
sudo ./scripts/install.sh
|
||
```
|
||
|
||
## 资源占用
|
||
|
||
- 单进程 **sing-box**
|
||
- 中文面板:内置静态 HTML(~20KB)
|
||
- 默认 `MemoryMax=96MB`,`LOG_LEVEL=warn`
|
||
|
||
## 管理
|
||
|
||
```bash
|
||
cpxy detect | generate | start | stop | restart | status | verify | logs
|
||
```
|
||
|
||
改配置后:`sudo cpxy generate`
|
||
|
||
## 配置摘要
|
||
|
||
见 `config/settings.conf.example`:
|
||
|
||
- `CELLULAR_IFACE` — 数据网卡
|
||
- `PROXY_MIXED_PORT` — HTTP+SOCKS 端口
|
||
- `PROXY_USER` / `PROXY_PASS` — 代理鉴权
|
||
- `PANEL_PORT` / `PANEL_SECRET` — 中文面板
|
||
- `ENABLE_DNS` — DNS 也从数据出
|
||
- `MEMORY_MAX_MB` — 内存上限
|
||
|
||
## 安全
|
||
|
||
局域网 `0.0.0.0` 时请设代理密码 + 面板 secret,防火墙限制来源网段。
|
||
`REQUIRE_CELLULAR_IFACE=true` 避免数据断开时静默走 WiFi。
|
||
|
||
## License
|
||
|
||
MIT(脚本与配置)。sing-box 遵循上游许可证。
|