Update USAGE.txt

This commit is contained in:
klzgrad 2020-06-20 14:16:26 +08:00
parent 8f5b1e4611
commit a3a09a9322

View File

@ -1,78 +1,84 @@
Usage: naive { OPTIONS | [/path/to/config.json] } Usage: naive --listen=... --proxy=...
naive [/path/to/config.json]
Description: Description:
naive is a proxy to transport traffic as Chromium traffic. It can be naive is a proxy that transports traffic in Chromium's pattern.
used as both the client and the server or together. It works as both a proxy client and a proxy server or together.
There are two ways to specify options. The first is through command Options in the form of `naive --listen=... --proxy=...` can also be
line flags: naive OPTIONS. The second is through a JSON specified using a JSON file:
configuration file. If there are no command line flags or path
specified, it will try to read from "config.json" by default.
The syntax of config.json fields are mapped exactly to command line {
flags, e.g. "listen": "...",
"proxy": "..."
}
{ Uses "config.json" by default if run without arguments.
"proxy": "https://user:pass@example.org"
}
is exactly the same as --proxy=https://user:pass@example.org. All
command line flags must have string values in config.json, except if
the flags are boolean then they must have boolean values too.
Options: Options:
-h, --help -h, --help
Shows help message. Shows help message.
--version --version
Prints version Prints version.
--listen=<proto>://[addr][:port] --listen=<proto>://[addr][:port]
Listens at addr:port with protocol <proto>. Allowed values for Listens at addr:port with protocol <proto>.
proto: "socks", "http", "redir". The default proto is socks.
The default addr is 0.0.0.0. The default port is 1080.
For redirecting local traffic from the same machine: Available proto: socks, http, redir.
Default proto, addr, port: socks, 0.0.0.0, 1080.
iptables -t nat -A OUTPUT -p tcp -d ... -j REDIRECT --to-ports 1080 * http: Supports only proxying https:// URLs, no http://.
For redirecting forwarded traffic on a router: * redir: Works with certain iptables setup.
iptables -t nat -A PREROUTING -p tcp -d ... -j REDIRECT --to-ports 1080 (Redirecting locally originated traffic)
iptables -t nat -A OUTPUT -d $proxy_server_ip -j RETURN
iptables -t nat -A OUTPUT -p tcp -j REDIRECT --to-ports 1080
--proxy=<proto>://[<user>:<pass>@]<hostname>[:<port>] (Redirecting forwarded traffic on a router)
iptables -t nat -A PREROUTING -p tcp -j REDIRECT --to-ports 1080
Routes traffic via the proxy server. Allowed values for proto: Also activates a DNS resolver on the same UDP port. Similar iptables
"https", "quic". The value of port is inferred from proto if not rules can redirect DNS queries to this resolver. The resolver returns
specified. artificial addresses that are translated back to the original domain
names in proxy requests and then resolved remotely.
If this option is not set, connects to origin server directly. The artificial results are not saved for privacy, so restarting the
resolver may cause downstream to cache stale results.
--padding --proxy=<proto>://<user>:<pass>@<hostname>[:<port>]
Obfuscates traffic by adding length paddings. Routes traffic via the proxy server. Connects directly by default.
Available proto: https, quic. Infers port by default.
--host-resolver-rules=... --extra-headers=...
This is the same as Chromium's flag of the same name. Google it Appends extra headers in requests to the proxy server.
as the full description is too technical. Multiple headers are separated by CRLF.
--log=[<path>] --host-resolver-rules="MAP proxy.example.com 1.2.3.4"
Saves log to the file at <path>. If <path> is empty, prints to Statically resolves a domain name to an IP address.
console.
If this option is not set, no log is saved for privacy. --resolver-range=CIDR
--log-net-log=<path> Uses this range in the builtin resolver. Default: 100.64.0.0/10.
Saves NetLog. View at https://netlog-viewer.appspot.com/. --log=[<path>]
--ssl-key-log-file=<path> Saves log to the file at <path>. If path is empty, prints to
console. No log is saved or printed by default for privacy.
Saves SSL keys for Wireshark inspection. --log-net-log=<path>
Saves NetLog. View at https://netlog-viewer.appspot.com/.
--ssl-key-log-file=<path>
Saves SSL keys for Wireshark inspection.