Skip to content

Commit 072f89d

Browse files
committed
Updated README for extended local configuration, #452
1 parent 435de94 commit 072f89d

File tree

1 file changed

+63
-1
lines changed

1 file changed

+63
-1
lines changed

README.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,73 @@ Example configuration:
289289

290290
```jsonc
291291
{
292-
// LOCAL: Listen address
292+
// LOCAL: Listen address. This is exactly the same as `locals[0]`
293293
// SERVER: Bind address for remote sockets, mostly used for choosing interface
294294
"local_address": "127.0.0.1",
295295
"local_port": 1080,
296296

297+
// Extended multiple local configuration
298+
"locals": [
299+
{
300+
// Basic configuration, a SOCKS5 local server
301+
"local_address": "127.0.0.1",
302+
"local_port": 1080,
303+
// OPTIONAL. Setting the `mode` for this specific local server instance.
304+
// If not set, it will derive from the outer `mode`
305+
"mode": "tcp_and_udp"
306+
},
307+
{
308+
// SOCKS5, SOCKS4/4a local server
309+
"protocol": "socks",
310+
// Listen address
311+
"local_address": "127.0.0.1",
312+
"local_port": 1081,
313+
// OPTIONAL. Enables UDP relay
314+
"mode": "tcp_and_udp",
315+
// OPTIONAL. Customizing the UDP's binding address. Depending on `mode`, if
316+
// - TCP is enabled, then SOCKS5's UDP Association command will return this address
317+
// - UDP is enabled, then SOCKS5's UDP server will listen to this address.
318+
"local_udp_address": "127.0.0.1",
319+
"local_udp_port": 2081
320+
},
321+
{
322+
// Tunnel local server (feature = "local-tunnel")
323+
"protocol": "tunnel",
324+
// Listen address
325+
"local_address": "127.0.0.1",
326+
"local_port": 5353,
327+
// Forward address, the target of this tunnel
328+
// In this example, this will build a `127.0.0.1:5353` -> `8.8.8.8:53` tunnel
329+
"forward_address": "8.8.8.8",
330+
"forward_port": 53,
331+
// OPTIONAL. Customizing whether to start TCP and UDP tunnel
332+
"mode": "tcp_only"
333+
},
334+
{
335+
// HTTP local server (feature = "local-http")
336+
"protocol": "http",
337+
// Listen address
338+
"local_address": "127.0.0.1",
339+
"local_port": 3128
340+
},
341+
{
342+
// DNS local server (feature = "local-dns")
343+
// This DNS works like China-DNS, it will send requests to `local_dns` and `remote_dns` and choose by ACL rules
344+
"protocol": "dns",
345+
// Listen address
346+
"local_address": "127.0.0.1",
347+
"local_port": 53,
348+
// Local DNS address, DNS queries will be sent directly to this address
349+
"local_dns_address": "114.114.114.114",
350+
// OPTIONAL. Local DNS's port, 53 by default
351+
"local_dns_port": 53,
352+
// Remote DNS address, DNS queries will be sent through ssserver to this address
353+
"remote_dns_address": "8.8.8.8",
354+
// OPTIONAL. Remote DNS's port, 53 by default
355+
"remote_dns_port": 53
356+
}
357+
],
358+
297359
// Server configuration
298360
// listen on [::] for dual stack support
299361
"server": "::",

0 commit comments

Comments
 (0)