refactor: переименовать флаги и поля CLI/конфига
- wrap → obf: -wrap/-wrap-key/-gen-wrap-key → -obf/-obf-key/-gen-obf-key;
ObfOpts.WrapMode/WrapKey/GenWrapKey → Mode/Key/GenKey
- vless → mode: -vless/-vless-bond → -mode tcp / -bond;
clientProxyMode/serverProxyMode принимают string вместо bool
- -udp → -transport tcp|udp; TURNOpts.UDP → TransportUDP (везде)
- -vk-link → -link; -dns → -dns-mode; DNSModeUDP → DNSModePlain ("plain")
- KCP: убрать LoadProfileFromEnv/LoadFECFromEnv — хардкодить DefaultProfile/FEC{}
- Добавить валидацию -transport/-mode/-bond/-dns-mode в ParseClient/ParseServer
This commit is contained in:
1 parent
6c3d3d341c
commit
31e35efbf3
13 files changed
+166
-212
No files matched your search
@@ -218,7 +218,7 @@ func oneTURN(ctx context.Context, deps *Deps, params *Params, peer *net.UDPAddr,
|
||||
err = ctx.Err()
|
||||
return
|
||||
}
|
||||
stream, err1 := common.DialTURN(ctx, params.Host, params.Port, params.UDP, peer, params.Link, streamID, params.GetCreds)
|
||||
stream, err1 := common.DialTURN(ctx, params.Host, params.Port, params.TransportUDP, peer, params.Link, streamID, params.GetCreds)
|
||||
if err1 != nil {
|
||||
if deps.Auth.IsAuthError(err1) {
|
||||
deps.Auth.HandleAuthError(streamID)
|
||||
@@ -254,7 +254,7 @@ func oneTURN(ctx context.Context, deps *Deps, params *Params, peer *net.UDPAddr,
|
||||
}
|
||||
})
|
||||
var internalPipeAddr atomic.Value
|
||||
wc, wcErr := common.NewClientWrap(params.WrapKey)
|
||||
wc, wcErr := common.NewClientWrap(params.ObfKey)
|
||||
if wcErr != nil {
|
||||
deps.log().Errorf("[STREAM %d] WRAP init failed: %v", streamID, wcErr)
|
||||
turncancel()
|
||||
|
||||
@@ -36,8 +36,8 @@ type Params struct {
|
||||
Host string
|
||||
Port string
|
||||
Link string
|
||||
UDP bool
|
||||
WrapKey []byte
|
||||
TransportUDP bool
|
||||
ObfKey []byte
|
||||
GetCreds GetCredsFunc
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user