diff --git a/README.md b/README.md index f286c80..fc63cb3 100755 --- a/README.md +++ b/README.md @@ -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 force source-port for raw socket,tcp/udp only this option disables port changing while re-connecting other options: + --config-file read options from a configuration file instead of command line --log-level 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 diff --git a/doc/README.zh-cn.md b/doc/README.zh-cn.md index 41ffca1..1423c6e 100644 --- a/doc/README.zh-cn.md +++ b/doc/README.zh-cn.md @@ -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)