feat:KCP协议

This commit is contained in:
nnbcccscdscdsc
2026-03-24 21:09:06 +08:00
parent 290ba18962
commit be013b701b
20 changed files with 2284 additions and 16 deletions

View File

@@ -18,6 +18,7 @@ var dialServer = dialServerWithOptions
type clientOptions struct {
logger latencylog.Logger
txTimestampDebugLogger transport.TXTimestampDebugLogger
kcpPacketDebugLogger transport.KCPPacketDebugLogger
bindIP string
bindDevice string
}
@@ -39,6 +40,13 @@ func WithTXTimestampDebugLogger(logger transport.TXTimestampDebugLogger) Option
}
}
// WithKCPPacketDebugLogger 为 KCP UDP packet timestamp 调试日志注入记录器。
func WithKCPPacketDebugLogger(logger transport.KCPPacketDebugLogger) Option {
return func(options *clientOptions) {
options.kcpPacketDebugLogger = logger
}
}
// WithBindIP 指定拨号时使用的本地源 IP。
func WithBindIP(ip string) Option {
return func(options *clientOptions) {