[关闭]
@sheepbao 2017-12-13T07:55:33.000000Z 字数 2753 阅读 1900

fastip-tun 使用说明

帮助

  1. ./bin/fastip-tun -h

fastip-tun 测试命令

  1. -test string
  2. use test mode, client or server
  3. -tfile string
  4. test read file path (default "/dev/urandom")
  5. -tla string
  6. test server listen addr (default ":8900")
  7. -tlsaddr string
  8. local tls listen address (default ":12000")
  9. -tmode string
  10. test mode which use, 'ping,upload,download,connect' (default "download")
  11. -tnum int
  12. client test connection number (default 1)
  13. -tproto string
  14. test net which use (default "tls")
  15. -tpwd string
  16. test password (default "123456")
  17. -tra string
  18. test client addr (default "127.0.0.1:11000")
  19. -trate int
  20. data rate (send or recv data speed per second) (default -1)
  21. -tsave
  22. save test data to file
  23. -tsize int
  24. test file size (default 104857600)
  25. -tuser string
  26. test username (default "test")

测试例子

启动监听11360端口的测试服务器,且模式为下载模式

./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
启动完后会在终端打印每秒的传输速率

配置文档说明

  1. bandwith = "100M" # 指定带宽,如:100M,200M,300M
  2. keepalive = 10 # 保持心跳的间隔时间
  3. timeout = 30 # 链路超时时间
  4. log_file = "" # 日志文件路径
  5. log_level = "info" # 日志的等级
  6. log_max_days = 7 # 日志最大保存天数
  7. net = "kcp" # 网络协议,有"kcp, ftcp"
  8. qos = false # 是否开启qos
  9. pprof = false # 开启golang pprof
  10. [client]
  11. auth_file = "" # 通道的认证文件
  12. faketcp_addr = ":14000" # faketcp协议的监听地址
  13. fastip_addr = ":13000" # fastip协议的监听地址
  14. http_addr = ":6000" # 客户端的http监听地址
  15. tcp_addr = ":11000" # tcp协议的监听地址
  16. tls_addr = ":12000" # tls服务器监听地址,如:":3000"
  17. nc_control_addr = "" # NC控制中心的http地址,如:"http://xx.xx.xx.xx"
  18. remote_addr = "" # 客户端连接的远程服务地址,如:"127.0.0.1:130000",为空则不启动tun的客户端
  19. src_port = 960 # 客户端的自身的连接端口
  20. trace_log = "" # 开启数据流跟踪日志
  21. [server]
  22. fastip_addr = ":13000" # fastip-tun的服务端监听地址,为空则不启动tun的服务端
  23. http_addr = ":6001" # 服务端的http监听地址
  24. trace_log = "" # 开启数据流跟踪日志
  25. [fastip]
  26. acknodelay = false # 是否开启acknodelay
  27. autoexpire = 0 # 设置自动session自动超时时间
  28. crypt = "salsa20" # 加密方式
  29. ds = 0 # fec的ds
  30. dscp = 46 # 设置dscp
  31. interval = 10 # 刷新时间
  32. key = "it's a secrect" # 加密密钥
  33. mtu = 1400 # 设置mtu
  34. nc = 1 # 关闭拥塞控制
  35. nocomp = false # 关闭数据压缩
  36. nodelay = 0 # rto超时nodelay
  37. ps = 0 # fec的ps
  38. rcvwnd = 1856 # 接收窗口大小
  39. resend = 0 # 快速重传参数
  40. scavengettl = 600 # 回收资源时间
  41. sndwnd = 1856 # 发送窗口大小
  42. sockbuf = 20000000 # scoket的缓冲大小
  43. writenodelay = false # fastip写数据不延时

http接口例子

关于链路信息查询

  1. echo 'get infos'
  2. curl -k https://127.0.0.1:5000/fastip/infos

关于tun

注意

update接口必须全量更新。

  1. echo 'get tun'
  2. curl -k -H "Content-type: application/json" \
  3. https://127.0.0.1:6002/fastip/tuns/get
  4. echo 'reload tun'
  5. curl -k -H "Content-type: application/json" \
  6. https://127.0.0.1:6002/fastip/tuns/reload
  7. echo 'add tun'
  8. 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
  9. echo 'update tun'
  10. 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
  11. echo 'del tun'
  12. 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
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注