wangyu- / tinyfecVPN

A VPN Designed for Lossy Links, with Build-in Forward Error Correction(FEC) Support. Improves your Network Quality on a High-latency Lossy Link.
MIT License
2.28k stars 456 forks source link

udp2raw 的自动重连无法保护tinyvpn #83

Open atxiu opened 5 years ago

atxiu commented 5 years ago

已查看 https://github.com/wangyu-/UDPspeeder/wiki/发Issue前请看 (否则Issue可能被忽略,或被直接关掉)

在 tinyvpn client -> udp2raw client -> udp2raw server -> tinyvpn server 场景下 故意重启或者停止再开启 tinyvpn server , 会导致 tinyvpn client 服务挂掉

tinyvpn_amd64[3472]: [2019-04-25 03:39:26][INFO]jitter_min=0 jitter_max=0 output_interval_min=0 output_interval_max=0 fec_ti...ec_mode=0
tinyvpn_amd64[3472]: [2019-04-25 03:39:26][INFO]fec_str=2:4
tinyvpn_amd64[3472]: [2019-04-25 03:39:26][INFO]fec_inner_parameter=1:4,2:4
tinyvpn_amd64[3472]: [2019-04-25 03:39:26][INFO]using interface tun643
tinyvpn_amd64[3472]: [2019-04-25 03:39:55][INFO]connection accepted by server
tinyvpn_amd64[3472]: [2019-04-25 03:41:25][FATAL]server restarted or switched to handle another client,exited. maybe you nee...reconnect

目前暂时用 systemctlRestart=always 参数解决。 能否在 tinyvpn client 端加上断线重连机制, udp2raw 是可以自动重连, 但无法带动 tinyvpn 重连。

CensorKo commented 2 years ago

tinyvpn自带的重连很慢,需要5分钟左右,如果只是单纯的想重启tinyvpn不如强杀来的快,只需1s

!/bin/sh

while true do ./tinyvpn .... sleep 1 done

kill -9 $(ps -ef|grep -v grep|grep "./bin/tinyvpn -c -r 127.0.0.1:xxx"|awk '$3 != 1'|awk '{print $2}')

wangyu- commented 3 weeks ago

故意重启或者停止再开启 tinyvpn server , 会导致 tinyvpn client 服务挂掉

这不是udp2raw自动重连能解决的。 udp2raw是网断了重连,你把server都杀了,那自然不行。

故意重启或者停止再开启 tinyvpn server , 会导致 tinyvpn client 服务挂掉

故意重启server确实client也要重启,client一旦连上,就只认当前这个server。 现在的设计确实不特别方便,但是一般也不需要经常故意重启server。如果一定要重启,那client也重启一下就解决了。也不是什么大问题。