README: document configuration files

This commit is contained in:
Peter Cai 2017-08-21 15:00:27 +08:00
parent 968d35178a
commit 32f344fd3c
No known key found for this signature in database
GPG Key ID: 71F5FB4E4F3FD54F
2 changed files with 51 additions and 0 deletions

@ -64,6 +64,31 @@ Assume your UDP is blocked or being QOS-ed or just poorly supported. Assume your
Now,an encrypted raw tunnel has been established between client and server through TCP port 4096. Connecting to UDP port 3333 at the client side is equivalent to connecting to port 7777 at the server side. No UDP traffic will be exposed.
### Configuration files
Alternatively, you can store the options into a configuration file in order to keep the secrets away from command line arguments.
For example, rewrite the options for the above `server` example into configuration file:
`server.conf`
```
-s
-l 0.0.0.0:4096
-r 127.0.0.1:7777
-a
-k passwd
--raw-mode faketcp
```
Pay attention to the `-k` parameter: the quotes around the password are removed. In configuration files we do not need quotes.
Then you could start the server with
```bash
./udp2raw_amd64 --config-file server.conf
```
### Note
to run on Android, see [Android_Guide](/doc/android_guide.md)
@ -91,6 +116,7 @@ client options:
--source-port <port> force source-port for raw socket,tcp/udp only
this option disables port changing while re-connecting
other options:
--config-file <string> read options from a configuration file instead of command line
--log-level <number> 0:never 1:fatal 2:error 3:warn
4:info (default) 5:debug 6:trace
--log-position enable file name,function name,line number in log

@ -80,6 +80,31 @@ https://github.com/wangyu-/udp2raw-tunnel/releases
现在client和server之间建立起了tunnel。想要在本地连接44.55.66.77:7777只需要连接 127.0.0.1:3333。来回的所有的udp流量会被经过tunneling发送。在外界看起来是tcp流量不会有udp流量暴露到公网。
### 配置文件
为了避免将密码等私密信息暴露在进程命令行参数内,你也可以使用 `配置文件` 来存储参数。
比如,将以上服务端参数改写成配置文件
`server.conf`:
```
-s
-l 0.0.0.0:4096
-r 127.0.0.1:7777
-a
-k passwd
--raw-mode faketcp
```
注意,当写入配置文件的时候,密码等参数两边的引号必须去除。
然后就可以使用下面的方式启动服务端
```bash
./udp2raw_amd64 --config-file server.conf
```
### 提醒
如果要在anroid上运行请看[Android简明教程](/doc/android_guide.md)