@sheepbao
2017-12-13T07:55:33.000000Z
字数 2753
阅读 2208
./bin/fastip-tun -h
-test stringuse test mode, client or server-tfile stringtest read file path (default "/dev/urandom")-tla stringtest server listen addr (default ":8900")-tlsaddr stringlocal tls listen address (default ":12000")-tmode stringtest mode which use, 'ping,upload,download,connect' (default "download")-tnum intclient test connection number (default 1)-tproto stringtest net which use (default "tls")-tpwd stringtest password (default "123456")-tra stringtest client addr (default "127.0.0.1:11000")-trate intdata rate (send or recv data speed per second) (default -1)-tsavesave test data to file-tsize inttest file size (default 104857600)-tuser stringtest 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,300Mkeepalive = 10 # 保持心跳的间隔时间timeout = 30 # 链路超时时间log_file = "" # 日志文件路径log_level = "info" # 日志的等级log_max_days = 7 # 日志最大保存天数net = "kcp" # 网络协议,有"kcp, ftcp"qos = false # 是否开启qospprof = 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 # 是否开启acknodelayautoexpire = 0 # 设置自动session自动超时时间crypt = "salsa20" # 加密方式ds = 0 # fec的dsdscp = 46 # 设置dscpinterval = 10 # 刷新时间key = "it's a secrect" # 加密密钥mtu = 1400 # 设置mtunc = 1 # 关闭拥塞控制nocomp = false # 关闭数据压缩nodelay = 0 # rto超时nodelayps = 0 # fec的psrcvwnd = 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/getecho 'reload tun'curl -k -H "Content-type: application/json" \https://127.0.0.1:6002/fastip/tuns/reloadecho '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/addecho '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/updateecho '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