title: Warp与Tor共存 tags: [] id: '2151' categories:
先搭建好Tor,方法点此。
./wgcf generate 拷贝内容如下:
[Interface]
PrivateKey = 我的私钥
Address = 172.16.0.2/32
Address = 2606:4700:110:8949:fed8:2642:a640:c8e1/128
DNS = 1.1.1.1
MTU = 1280
[Peer]
PublicKey = Warp公钥
AllowedIPs = 0.0.0.0/0
AllowedIPs = ::/0
Endpoint = engage.cloudflareclient.com:2408
version: '3.3'
services:
socks5:
container_name: socks5
restart: always
volumes:
- './config/:/etc/sing-box/'
image: gzxhwq/sing-box:git
networks:
default:
external: true
name: sswitch
{
"log": {
"level": "info"
},
"inbounds": [
{
"type": "socks",
"tag": "socks-in",
"listen": "::",
"listen_port": 5353,
"tcp_fast_open": false,
"udp_fragment": false,
"sniff": true,
"sniff_override_destination": false,
"sniff_timeout": "300ms",
"udp_timeout": 300,
"proxy_protocol": false,
"proxy_protocol_accept_no_header": false
}
],
"outbounds": [
{
"type": "direct"
},
{
"type": "wireguard",
"tag": "wireguard",
"server": "engage.cloudflareclient.com",
"server_port": 2408,
"local_address": ["10.0.0.2/32","fd00::1/128"],
"private_key": "我的私钥",
"peer_public_key": "Warp公钥"
},
{
"type": "socks",
"tag": "tor",
"server": "tor",
"server_port": 9050
}
],
"route": {
"rules": [
{
"domain_suffix": [".onion"],
"outbound": "tor"
},
{
"domain_suffix": ["openai.com"],
"outbound": "wireguard"
},
{
"domain_suffix": [".cn"],
"outbound": "wireguard"
},
{
"domain_suffix": ["check.torproject.org"],
"outbound": "tor"
},
{
"domain_suffix": ["myip.ipip.net"],
"outbound": "wireguard"
},
{
"geoip": ["cn"],
"outbound": "wireguard"
},
{
"geosite": ["cn"],
"outbound": "wireguard"
}
]
}
}