Skip to content

Commit 4490fd8

Browse files
committed
upd doc
1 parent 3bb52e7 commit 4490fd8

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

README.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,7 @@ dumbproxy can select upstream proxy dynamically invoking `getProxy` JS function
295295

296296
Note that this option can be repeated multiple times, same as `-proxy` option for chaining of proxies. These two options can be used together and order of chaining will be as they come in command line. For generalization purposes we can say that `-proxy` option is equivalent to `-js-proxy-router` option with script which returns just one static proxy.
297297

298-
`getProxy` function is invoked with the [same parameters](#access-filter-by-js-script) as the `access` function. But unlike `access` function it is expected to return proxy URL in string format *scheme://[user:password@]host:port* or empty string `""` if no additional upstream proxy needed (i.e. direct connection if there are no other proxy dialers defined in chain).
299-
300-
Supported proxy schemes are:
301-
* `http` - regular HTTP proxy with the CONNECT method support.
302-
* `https` - HTTP proxy over TLS connection.
303-
* `socks5`, `socks5h` - SOCKS5 proxy with hostname resolving via remote proxy.
304-
* `set-src-hints` - not an actual proxy, but a signal to use different source IP address hints for this connection. It's useful to route traffic across multiple network interfaces, including VPN connections. URL has to have one query parameter `hints` with a comma-separated list of IP addresses. See `-ip-hints` command line option for more details. Example: `set-src-hints://?hints=10.2.0.2`
298+
`getProxy` function is invoked with the [same parameters](#access-filter-by-js-script) as the `access` function. But unlike `access` function it is expected to return proxy URL in string format *scheme://[user:password@]host:port* or empty string `""` if no additional upstream proxy needed (i.e. direct connection if there are no other proxy dialers defined in chain). See [supported upstream proxy schemes](#supported-upstream-proxy-schemes) for details.
305299

306300
Example:
307301

@@ -321,6 +315,24 @@ function getProxy(req, dst, username) {
321315
>
322316
> This shouldn't be much of concern, though, if `getProxy` function doesn't use dst.resolvedHost and returns consistent values across invocations with the rest of inputs having same values.
323317
318+
## Supported upstream proxy schemes
319+
320+
Supported proxy schemes are:
321+
322+
* `http` - regular HTTP proxy with the CONNECT method support. Examples: `http://example.org:3128`.
323+
* `https` - HTTP proxy over TLS connection. Examples: `https://user:[email protected]`, `https://example.org?cert=cert.pem&key=key.pem`. This method also supports additional parameters passed in query string:
324+
* `cafile` - file with CA certificates in PEM format used to verify TLS peer.
325+
* `sni` - override value of ServerName Indication extension.
326+
* `peername` - expect specified name in peer certificate. Empty string relaxes any name constraints.
327+
* `cert` - file with user certificate for mutual TLS authentication. Should be used in conjunction with `key`.
328+
* `key` - file with private key matching user certificate specified with `cert` option.
329+
* `ciphers` - colon-separated list of enabled TLS ciphersuites.
330+
* `curves` - colon-separated list of enabled TLS key exchange curves.
331+
* `min-tls-version` - minimum TLS version.
332+
* `max-tls-version` - maximum TLS version.
333+
* `socks5`, `socks5h` - SOCKS5 proxy with hostname resolving via remote proxy. Example: `socks5://127.0.0.1:9050`.
334+
* `set-src-hints` - not an actual proxy, but a signal to use different source IP address hints for this connection. It's useful to route traffic across multiple network interfaces, including VPN connections. URL has to have one query parameter `hints` with a comma-separated list of IP addresses. See `-ip-hints` command line option for more details. Example: `set-src-hints://?hints=10.2.0.2`
335+
324336
## Synopsis
325337

326338
```
@@ -354,8 +366,6 @@ Usage of /home/user/go/bin/dumbproxy:
354366
restrict autocert domains to this comma-separated list
355367
-bind-address string
356368
HTTP proxy listen address. Set empty value to use systemd socket activation. (default ":8080")
357-
-proxyproto
358-
listen proxy protocol
359369
-bind-pprof string
360370
enables pprof debug endpoints
361371
-bind-reuseport
@@ -372,6 +382,8 @@ Usage of /home/user/go/bin/dumbproxy:
372382
enable TLS and use certificate
373383
-ciphers string
374384
colon-separated list of enabled ciphers
385+
-curves string
386+
colon-separated list of enabled key exchange curves
375387
-deny-dst-addr value
376388
comma-separated list of CIDR prefixes of forbidden IP addresses (default 127.0.0.0/8, 0.0.0.0/32, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, ::1/128, ::/128, fe80::/10)
377389
-disable-http2
@@ -400,16 +412,20 @@ Usage of /home/user/go/bin/dumbproxy:
400412
key for TLS certificate
401413
-list-ciphers
402414
list ciphersuites
415+
-list-curves
416+
list key exchange curves
403417
-max-tls-version value
404418
maximum TLS version accepted by server (default TLS13)
405419
-min-tls-version value
406-
minimal TLS version accepted by server (default TLS12)
420+
minimum TLS version accepted by server (default TLS12)
407421
-passwd string
408422
update given htpasswd file and add/set password for username. Username and password can be passed as positional arguments or requested interactively
409423
-passwd-cost int
410424
bcrypt password cost (for -passwd mode) (default 4)
411425
-proxy value
412426
upstream proxy URL. Can be repeated multiple times to chain proxies. Examples: socks5h://127.0.0.1:9050; https://user:[email protected]:443
427+
-proxyproto
428+
listen proxy protocol
413429
-req-header-timeout duration
414430
amount of time allowed to read request headers (default 30s)
415431
-user-ip-hints

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ func parse_args() CLIArgs {
295295
})
296296
flag.StringVar(&args.sourceIPHints, "ip-hints", "", "a comma-separated list of source addresses to use on dial attempts. \"$lAddr\" gets expanded to local address of connection. Example: \"10.0.0.1,fe80::2,$lAddr,0.0.0.0,::\"")
297297
flag.BoolVar(&args.userIPHints, "user-ip-hints", false, "allow IP hints to be specified by user in X-Src-IP-Hints header")
298-
flag.Var(&args.minTLSVersion, "min-tls-version", "minimal TLS version accepted by server")
298+
flag.Var(&args.minTLSVersion, "min-tls-version", "minimum TLS version accepted by server")
299299
flag.Var(&args.maxTLSVersion, "max-tls-version", "maximum TLS version accepted by server")
300300
flag.Uint64Var(&args.bwLimit, "bw-limit", 0, "per-user bandwidth limit in bytes per second")
301301
flag.UintVar(&args.bwBuckets, "bw-limit-buckets", 1024*1024, "number of buckets of bandwidth limit")

0 commit comments

Comments
 (0)