proxy-networking
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseProxy Networking
代理网络构建
Goal
目标
Build a relay-to-exit proxy network from user-supplied relay machines, exit machines, bandwidth, and relationship mappings.
Default target:
text
client -> relay sing-box VLESS Reality inbound -> WireGuard tunnel -> exit Linux egressFlexible migration target:
text
client -> existing relay entrypoint -> existing Realm bridge -> WireGuard tunnel -> existing exit Xray/VLESS RealityUse / as the preferred installer and manager for Xray or sing-box VLESS Reality when a host needs a new VLESS stack or already uses that project. Directly edit generated configs when preserving existing links, adding WireGuard behind an existing service, or making a small targeted repair.
v2ray-agentvasmaKeep TCP/kernel tuning delegated to the skill in this repository. Use this skill for topology, proxy services, WireGuard links, maintenance, link generation, and per-link measurement.
network-tune基于用户提供的中继机器、出口机器、带宽及关联映射,构建中继到出口的代理网络。
默认目标拓扑:
text
client -> relay sing-box VLESS Reality inbound -> WireGuard tunnel -> exit Linux egress灵活迁移目标拓扑:
text
client -> existing relay entrypoint -> existing Realm bridge -> WireGuard tunnel -> existing exit Xray/VLESS Reality当主机需要新的VLESS栈或已在使用该项目时,优先使用/作为Xray或sing-box VLESS Reality的安装器与管理器。当需要保留现有链路、在现有服务后添加WireGuard或进行小范围定向修复时,直接编辑生成的配置文件。
v2ray-agentvasma将TCP/内核调优任务委托给本仓库中的技能。本技能负责拓扑设计、代理服务配置、WireGuard链路搭建、维护工作、链接生成及单链路性能测试。
network-tuneInputs To Normalize
需要标准化的输入
Collect or infer a topology table before changing hosts:
text
relays:
- ip / ssh target / bandwidth / region / current services / desired public ports
exits:
- ip / ssh target / bandwidth / region / current services / desired egress role
relationships:
- relay -> one or more exits
- per relationship: public inbound port, protocol preference, preserve existing link yes/no, labelIf the user gives only IPs, use . Treat bandwidth values as operator intent; use Speedtest or iperf only to validate link behavior.
root@IP在修改主机前,收集或推断拓扑表:
text
relays:
- ip / ssh目标 / 带宽 / 区域 / 当前服务 / 期望公网端口
exits:
- ip / ssh目标 / 带宽 / 区域 / 当前服务 / 期望出口角色
relationships:
- relay -> 一个或多个exits
- 每个关联项:公网入站端口、协议偏好、是否保留现有链路、标签若用户仅提供IP,则使用作为SSH目标。将带宽值视为运维意图;仅使用Speedtest或iperf验证链路行为。
root@IPWorkflow
工作流程
- Run preflight before changing any host:
- Read .
references/preflight.md - Mark a host or relationship as when kernel, package, disk, SSH, port, or UDP direction checks fail.
blocked - Keep blocked relationships on their current working path and report the exact blocker.
- Read
- Inventory every relay and exit over SSH:
- OS, kernel, public/private IPs, interfaces, routes, bandwidth notes.
- Services: ,
sing-box,xray,realm,wg-quick@*,nginx,hysteria.tuic - Config paths: ,
/root/realm.toml,/etc/v2ray-agent/xray/conf,/etc/sing-box,/usr/local/etc/sing-box./etc/wireguard
- Classify each relationship:
- Fresh build: relay terminates VLESS Reality with sing-box and exits through WireGuard.
- Existing Realm bridge: keep the client-facing port and change Realm's remote target to the exit WireGuard IP.
- Existing sing-box/Xray entry: add only missing inbounds, outbounds, routes, peers, or systemd persistence.
- Create a per-link plan:
- WireGuard tunnel address, port, MTU, preshared key, allowed IPs.
- WireGuard interface name, compressed to Linux's 15-byte interface limit.
- Relay inbound tag and public port.
- Exit egress behavior: NAT gateway for fresh builds, or private Xray target for bridge preservation.
- Connection direction: relay dials exit, or exit dials relay when exit-side public UDP ingress is unavailable.
- Verification commands and rollback paths.
- Apply one relationship at a time using the state model in :
references/link-state.md- Back up all touched files with timestamps.
- Follow for SSH invocation shape.
references/ssh-execution.md - Follow before installing packages.
references/package-policy.md - Use /
v2ray-agentfor fresh VLESS Reality stacks when appropriate.vasma - Create or update WireGuard peers.
- Create or update sing-box, Realm, Xray, NAT, and systemd units according to the selected pattern.
- For Realm bridge updates, follow and prefer
references/realm-safety.md.scripts/patch-realm-endpoint.py
- Verify:
- Read .
references/verification.md - , ping over WireGuard, TCP reachability to private exit target.
wg show - public UDP, WireGuard TCP, and reverse direction tests.
iperf3 - Client-facing port reachability from the relay.
- Service persistence after reboot when the user permits reboot verification.
- Read
- Report:
- Topology, active services, per-link private IPs, throughput, pacing, rollback paths.
- Completed relationships, preserved relationships, blocked relationships, and required host repairs.
- Mention VLESS share links can be generated on request. Provide links only when requested.
- 在修改任何主机前执行预检:
- 阅读。
references/preflight.md - 当内核、包、磁盘、SSH、端口或UDP方向检查失败时,将主机或关联项标记为。
blocked - 保留被阻断关联项的当前工作路径,并报告具体的阻断原因。
- 阅读
- 通过SSH盘点所有中继和出口机器:
- 操作系统、内核、公网/私有IP、接口、路由、带宽记录。
- 服务:、
sing-box、xray、realm、wg-quick@*、nginx、hysteria。tuic - 配置路径:、
/root/realm.toml、/etc/v2ray-agent/xray/conf、/etc/sing-box、/usr/local/etc/sing-box。/etc/wireguard
- 对每个关联项进行分类:
- 全新构建:中继通过sing-box终止VLESS Reality连接,并通过WireGuard连接到出口。
- 现有Realm桥接:保留面向客户端的端口,将Realm的远程目标修改为出口WireGuard IP。
- 现有sing-box/Xray入口:仅添加缺失的入站、出站、路由、对等节点或systemd持久化配置。
- 创建单链路规划:
- WireGuard隧道地址、端口、MTU、预共享密钥、允许的IP范围。
- WireGuard接口名称,压缩至Linux的15字节接口限制。
- 中继入站标签和公网端口。
- 出口行为:全新构建时作为NAT网关,或在保留桥接时作为私有Xray目标。
- 连接方向:当中 Exit 侧公网UDP入站不可用时,选择中继主动连接出口,或出口主动连接中继。
- 验证命令和回滚路径。
- 参照中的状态模型,逐一应用关联项配置:
references/link-state.md- 为所有修改的文件添加时间戳备份。
- 遵循中的SSH调用规范。
references/ssh-execution.md - 安装包前遵循。
references/package-policy.md - 适当时使用/
v2ray-agent部署全新VLESS Reality栈。vasma - 创建或更新WireGuard对等节点。
- 根据所选模式创建或更新sing-box、Realm、Xray、NAT及systemd单元。
- 更新Realm桥接时,遵循,优先使用
references/realm-safety.md。scripts/patch-realm-endpoint.py
- 验证:
- 阅读。
references/verification.md - 执行、WireGuard内ping测试、私有出口目标的TCP可达性测试。
wg show - 执行公网UDP、WireGuard TCP及反向方向测试。
iperf3 - 从中验证面向客户端的端口可达性。
- 若用户允许重启验证,则测试重启后的服务持久性。
- 阅读
- 报告:
- 拓扑结构、运行中服务、单链路私有IP、吞吐量、 pacing、回滚路径。
- 已完成的关联项、保留的关联项、被阻断的关联项及所需的主机修复工作。
- 提及可按需生成VLESS共享链接,仅在用户请求时提供链接。
References
参考资料
Read the matching reference before implementation:
- for inventory, build/update decision rules, and verification.
references/topology-workflow.md - for using
references/v2ray-agent.md/v2ray-agentas the VLESS Reality implementation layer.vasma - for WireGuard, sing-box, Realm, Xray, NAT, tuning, and rollback patterns.
references/config-patterns.md - for host checks before any change.
references/preflight.md - for per-relationship state tracking and resume behavior.
references/link-state.md - for interface naming, address planning, and connection direction.
references/wireguard-rules.md - for safe Realm endpoint updates.
references/realm-safety.md - for SSH execution patterns in batch changes.
references/ssh-execution.md - for conservative package installation rules.
references/package-policy.md - for acceptance checks.
references/verification.md - for extracting and generating VLESS Reality share links.
references/vless-links.md
Use to generate share links from known fields.
Use to update one Realm endpoint safely.
scripts/gen-vless-link.pyscripts/patch-realm-endpoint.pyExample:
bash
scripts/gen-vless-link.py \
--host 8.209.199.131 \
--port 15659 \
--uuid 00000000-0000-0000-0000-000000000000 \
--sni www.example.com \
--public-key REALITY_PUBLIC_KEY \
--short-id abcd1234 \
--flow xtls-rprx-vision \
--name "relay-8-to-exit-45"实施前阅读对应参考文档:
- :盘点、构建/更新决策规则及验证流程。
references/topology-workflow.md - :使用
references/v2ray-agent.md/v2ray-agent作为VLESS Reality实现层的指南。vasma - :WireGuard、sing-box、Realm、Xray、NAT、调优及回滚模式。
references/config-patterns.md - :修改前的主机检查规范。
references/preflight.md - :关联项状态跟踪及恢复行为。
references/link-state.md - :接口命名、地址规划及连接方向规则。
references/wireguard-rules.md - :安全更新Realm端点的指南。
references/realm-safety.md - :批量修改中的SSH执行模式。
references/ssh-execution.md - :保守的包安装规则。
references/package-policy.md - :验收检查规范。
references/verification.md - :提取及生成VLESS Reality共享链接的指南。
references/vless-links.md
使用从已知字段生成共享链接。
使用安全更新单个Realm端点。
scripts/gen-vless-link.pyscripts/patch-realm-endpoint.py示例:
bash
scripts/gen-vless-link.py \
--host 8.209.199.131 \
--port 15659 \
--uuid 00000000-0000-0000-0000-000000000000 \
--sni www.example.com \
--public-key REALITY_PUBLIC_KEY \
--short-id abcd1234 \
--flow xtls-rprx-vision \
--name "relay-8-to-exit-45"Safety Rules
安全规则
- Prefer preserving working client-facing links during migration.
- Back up every edited remote file with a timestamp.
- Keep existing unrelated inbounds and exits active.
- Use when supported; use restart only after validating config syntax.
systemctl reload - Limit live traffic disruption to the specific relationship being changed.
- Treat generated VLESS links as sensitive credentials.
- Treat a relationship as blocked when preflight fails; leave its current working route in place.
- Never run a multi-link batch as one opaque operation; each relationship needs its own state and verification result.
- 迁移时优先保留可用的面向客户端链路。
- 为所有编辑的远程文件添加时间戳备份。
- 保持现有无关的入站及出口服务处于活跃状态。
- 支持时优先使用;仅在验证配置语法正确后使用重启操作。
systemctl reload - 将实时流量中断限制在正在修改的特定关联项范围内。
- 将生成的VLESS链接视为敏感凭证。
- 预检失败时将关联项标记为阻断,保留其当前工作路由。
- 绝不能将多链路批量操作作为单一不透明任务执行;每个关联项都需要独立的状态跟踪和验证结果。