mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-12 04:06:37 +08:00
fix(tunnel): resolve UDP stream interruption and add KCP protocol support
- Increase UDP listener default TTL from 5s to 30s to prevent idle disconnect - Add mux keepalive config (15s interval, 45s timeout) to tunnel relay handler - Add KCP as tunnel chain transport protocol with keepalive and UDP mode default - Add KCP protocol option to tunnel UI (frontend) - Remove generic 'tcp' fallback key from KCP metadata to prevent false TCP mode - Simplify forward service config by removing unused tunnelTLSProtocol parameter
This commit is contained in:
@@ -42,7 +42,7 @@ func (d *kcpDialer) parseMetadata(md mdata.Metadata) (err error) {
|
||||
if d.md.config == nil {
|
||||
d.md.config = kcp_util.DefaultConfig
|
||||
}
|
||||
d.md.config.TCP = mdutil.GetBool(md, "kcp.tcp", "tcp")
|
||||
d.md.config.TCP = mdutil.GetBool(md, "kcp.tcp")
|
||||
d.md.config.Key = mdutil.GetString(md, "kcp.key")
|
||||
d.md.config.Crypt = mdutil.GetString(md, "kcp.crypt")
|
||||
d.md.config.Mode = mdutil.GetString(md, "kcp.mode")
|
||||
|
||||
@@ -40,7 +40,7 @@ var (
|
||||
SnmpLog: "",
|
||||
SnmpPeriod: 60,
|
||||
Signal: false,
|
||||
TCP: false,
|
||||
TCP: false, // default UDP mode (use tcpraw when true)
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ func (l *kcpListener) parseMetadata(md mdata.Metadata) (err error) {
|
||||
if l.md.config == nil {
|
||||
l.md.config = kcp_util.DefaultConfig
|
||||
}
|
||||
l.md.config.TCP = mdutil.GetBool(md, "kcp.tcp", "tcp")
|
||||
l.md.config.TCP = mdutil.GetBool(md, "kcp.tcp")
|
||||
l.md.config.Key = mdutil.GetString(md, "kcp.key")
|
||||
l.md.config.Crypt = mdutil.GetString(md, "kcp.crypt")
|
||||
l.md.config.Mode = mdutil.GetString(md, "kcp.mode")
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
defaultTTL = 5 * time.Second
|
||||
defaultTTL = 30 * time.Second
|
||||
defaultReadBufferSize = 8192
|
||||
defaultReadQueueSize = 1024
|
||||
defaultBacklog = 128
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
defaultTTL = 5 * time.Second
|
||||
defaultTTL = 30 * time.Second
|
||||
defaultReadBufferSize = 8192
|
||||
defaultReadQueueSize = 128
|
||||
defaultBacklog = 128
|
||||
|
||||
Reference in New Issue
Block a user