mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-06-09 22:09:56 +00:00
Set default timeout to 300s for TUN
This commit is contained in:
parent
81128a7626
commit
284efce6db
@ -192,6 +192,10 @@ func client(config *clientConfig) {
|
|||||||
|
|
||||||
if len(config.TUN.Name) != 0 {
|
if len(config.TUN.Name) != 0 {
|
||||||
go func() {
|
go func() {
|
||||||
|
timeout := time.Duration(config.TUN.Timeout) * time.Second
|
||||||
|
if timeout == 0 {
|
||||||
|
timeout = 300 * time.Second
|
||||||
|
}
|
||||||
tunServer, err := tun.NewServer(client, transport.DefaultTransport,
|
tunServer, err := tun.NewServer(client, transport.DefaultTransport,
|
||||||
time.Duration(config.TUN.Timeout)*time.Second,
|
time.Duration(config.TUN.Timeout)*time.Second,
|
||||||
config.TUN.Name, config.TUN.Address, config.TUN.Gateway, config.TUN.Mask, config.TUN.DNS, config.TUN.Persist)
|
config.TUN.Name, config.TUN.Address, config.TUN.Gateway, config.TUN.Mask, config.TUN.DNS, config.TUN.Persist)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user