-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
128 lines (118 loc) · 4.58 KB
/
Copy pathdocker-compose.yml
File metadata and controls
128 lines (118 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# ============================================================================
# docker-compose.yml -- Example deployment topologies for rustun
#
# Usage:
# docker compose up -d # start all services
# docker compose up http-proxy # start only the HTTP proxy
# docker compose logs -f # follow logs
# docker compose down # stop everything
# ============================================================================
services:
# --------------------------------------------------------------------------
# 1. HTTP Proxy
# Listens on port 8080. Clients configure HTTP proxy to host:8080.
# --------------------------------------------------------------------------
http-proxy:
build: .
command: ["-L", "http://:8080", "-D"]
ports:
- "8080:8080"
restart: unless-stopped
# --------------------------------------------------------------------------
# 2. SOCKS5 Proxy
# Listens on port 1080. Supports username/password authentication.
# --------------------------------------------------------------------------
socks5-proxy:
build: .
command: ["-L", "socks5://admin:password@:1080", "-D"]
ports:
- "1080:1080"
restart: unless-stopped
# --------------------------------------------------------------------------
# 3. Auto-Detect Proxy
# Listens on port 8888. Automatically detects HTTP, SOCKS4, or SOCKS5
# based on the first byte of each incoming connection.
# --------------------------------------------------------------------------
auto-proxy:
build: .
command: ["-L", ":8888", "-D"]
ports:
- "8888:8888"
restart: unless-stopped
# --------------------------------------------------------------------------
# 4. Shadowsocks Server
# Listens on port 8338 with AES-256-GCM encryption.
# --------------------------------------------------------------------------
shadowsocks:
build: .
command: ["-L", "ss://aes-256-gcm:supersecret@:8338", "-D"]
ports:
- "8338:8338"
restart: unless-stopped
# --------------------------------------------------------------------------
# 5. Relay Server
# Listens on port 8443 with authentication.
# --------------------------------------------------------------------------
relay-server:
build: .
command: ["-L", "relay://relayuser:relaypass@:8443", "-D"]
ports:
- "8443:8443"
restart: unless-stopped
# --------------------------------------------------------------------------
# 6. TCP Port Forwarding
# Forwards local port 2222 to an SSH server at target-ssh:22.
# Demonstrates TCP direct forwarding with load balancing.
# --------------------------------------------------------------------------
tcp-forward:
build: .
command: ["-L", "tcp://:2222/target-ssh:22", "-D"]
ports:
- "2222:2222"
restart: unless-stopped
# --------------------------------------------------------------------------
# 7. DNS Proxy
# Forwards DNS queries on port 5353 to Google Public DNS.
# --------------------------------------------------------------------------
dns-proxy:
build: .
command: ["-L", "dns://:5353/8.8.8.8:53", "-D"]
ports:
- "5353:5353"
restart: unless-stopped
# --------------------------------------------------------------------------
# 8. SNI Proxy
# Routes TLS connections based on the SNI hostname in the ClientHello.
# --------------------------------------------------------------------------
sni-proxy:
build: .
command: ["-L", "sni://:4443", "-D"]
ports:
- "4443:4443"
restart: unless-stopped
# --------------------------------------------------------------------------
# 9. Chained Proxy
# Local proxy on port 9080 that chains through the HTTP proxy.
# Traffic path: client -> 9080 -> http-proxy:8080 -> target
# --------------------------------------------------------------------------
chained-proxy:
build: .
command: ["-L", ":9080", "-F", "http://http-proxy:8080", "-D"]
ports:
- "9080:9080"
depends_on:
- http-proxy
restart: unless-stopped
# --------------------------------------------------------------------------
# 10. Multi-Listener (from config file)
# Uses a JSON config to start multiple services at once.
# --------------------------------------------------------------------------
multi-listener:
build: .
command: ["-C", "/etc/rustun/config.json", "-D"]
ports:
- "18080:8080"
- "11080:1080"
volumes:
- ./examples/config.json:/etc/rustun/config.json:ro
restart: unless-stopped