feat:多跳(B->D->C->A)功能

This commit is contained in:
nnbcccscdscdsc
2026-03-27 23:03:00 +08:00
parent 5be3ff670f
commit 8e2bd0ffc6
8 changed files with 455 additions and 51 deletions

View File

@@ -25,6 +25,7 @@ type clientOptions struct {
udpLinuxTimestamping bool
bindIP string
bindDevice string
kcpDialAddress string
}
// Option 用于配置 Client 的可选行为,例如时延日志。
@@ -73,6 +74,13 @@ func WithBindDevice(device string) Option {
}
}
// WithKCPDialAddress 指定 KCP 实际拨号使用的 UDP 地址,可用于通过 relay 连接逻辑上的 server。
func WithKCPDialAddress(addr string) Option {
return func(options *clientOptions) {
options.kcpDialAddress = addr
}
}
// WithUDPLinuxTimestamping controls whether UDP clients enable Linux timestamping.
func WithUDPLinuxTimestamping(enabled bool) Option {
return func(options *clientOptions) {