@sheepbao
2017-12-13T15:55:33.000000Z
字数 2753
阅读 2006
./bin/fastip-tun -h
-test string
use test mode, client or server
-tfile string
test read file path (default "/dev/urandom")
-tla string
test server listen addr (default ":8900")
-tlsaddr string
local tls listen address (default ":12000")
-tmode string
test mode which use, 'ping,upload,download,connect' (default "download")
-tnum int
client test connection number (default 1)
-tproto string
test net which use (default "tls")
-tpwd string
test password (default "123456")
-tra string
test client addr (default "127.0.0.1:11000")
-trate int
data rate (send or recv data speed per second) (default -1)
-tsave
save test data to file
-tsize int
test file size (default 104857600)
-tuser string
test username (default "test")
./fastip-tun -test server -tla :11360 -tmode download
假设 fastip-tun的客户端监听的地址为':8090'
./fastip-tun -test client -tra 127.0.0.1:8090 -tuser test -tpwd 123456 -tmode download
启动完后会在终端打印每秒的传输速率
bandwith = "100M" # 指定带宽,如:100M,200M,300M
keepalive = 10 # 保持心跳的间隔时间
timeout = 30 # 链路超时时间
log_file = "" # 日志文件路径
log_level = "info" # 日志的等级
log_max_days = 7 # 日志最大保存天数
net = "kcp" # 网络协议,有"kcp, ftcp"
qos = false # 是否开启qos
pprof = false # 开启golang pprof
[client]
auth_file = "" # 通道的认证文件
faketcp_addr = ":14000" # faketcp协议的监听地址
fastip_addr = ":13000" # fastip协议的监听地址
http_addr = ":6000" # 客户端的http监听地址
tcp_addr = ":11000" # tcp协议的监听地址
tls_addr = ":12000" # tls服务器监听地址,如:":3000"
nc_control_addr = "" # NC控制中心的http地址,如:"http://xx.xx.xx.xx"
remote_addr = "" # 客户端连接的远程服务地址,如:"127.0.0.1:130000",为空则不启动tun的客户端
src_port = 960 # 客户端的自身的连接端口
trace_log = "" # 开启数据流跟踪日志
[server]
fastip_addr = ":13000" # fastip-tun的服务端监听地址,为空则不启动tun的服务端
http_addr = ":6001" # 服务端的http监听地址
trace_log = "" # 开启数据流跟踪日志
[fastip]
acknodelay = false # 是否开启acknodelay
autoexpire = 0 # 设置自动session自动超时时间
crypt = "salsa20" # 加密方式
ds = 0 # fec的ds
dscp = 46 # 设置dscp
interval = 10 # 刷新时间
key = "it's a secrect" # 加密密钥
mtu = 1400 # 设置mtu
nc = 1 # 关闭拥塞控制
nocomp = false # 关闭数据压缩
nodelay = 0 # rto超时nodelay
ps = 0 # fec的ps
rcvwnd = 1856 # 接收窗口大小
resend = 0 # 快速重传参数
scavengettl = 600 # 回收资源时间
sndwnd = 1856 # 发送窗口大小
sockbuf = 20000000 # scoket的缓冲大小
writenodelay = false # fastip写数据不延时
echo 'get infos'
curl -k https://127.0.0.1:5000/fastip/infos
update接口必须全量更新。
echo 'get tun'
curl -k -H "Content-type: application/json" \
https://127.0.0.1:6002/fastip/tuns/get
echo 'reload tun'
curl -k -H "Content-type: application/json" \
https://127.0.0.1:6002/fastip/tuns/reload
echo 'add tun'
curl -k -H "Content-type: application/json" -X POST -d '{"targets": ["127.0.0.1:11450"],"password": "123456","speed": -1,"username": "test2","id": 120}' https://127.0.0.1:6002/fastip/tuns/add
echo 'update tun'
curl -k -H "Content-type: application/json" -X POST -d '{"targets": ["127.0.0.1:11451"],"password": "123456","speed": -1,"username": "test2","id": 120}' https://127.0.0.1:6002/fastip/tuns/update
echo 'del tun'
curl -k -H "Content-type: application/json" -X POST -d '{"targets": ["127.0.0.1:11451"],"password": "123456","speed": -1,"username": "test2","id": 120}' https://127.0.0.1:6002/fastip/tuns/del