From 59edcf33bd5ccd5be7188e6b3ba6a019f4fc29c2 Mon Sep 17 00:00:00 2001 From: H1JK Date: Sun, 2 Oct 2022 22:42:33 +0800 Subject: [PATCH] feat: Add VMess global padding support --- adapter/outbound/vmess.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adapter/outbound/vmess.go b/adapter/outbound/vmess.go index b8d09f45..a66ee40f 100644 --- a/adapter/outbound/vmess.go +++ b/adapter/outbound/vmess.go @@ -54,6 +54,7 @@ type VmessOption struct { PacketAddr bool `proxy:"packet-addr,omitempty"` XUDP bool `proxy:"xudp,omitempty"` PacketEncoding string `proxy:"packet-encoding,omitempty"` + GlobalPadding bool `proxy:"global-padding,omitempty"` AuthenticatedLength bool `proxy:"authenticated-length,omitempty"` } @@ -311,6 +312,9 @@ func (v *Vmess) SupportUOT() bool { func NewVmess(option VmessOption) (*Vmess, error) { security := strings.ToLower(option.Cipher) var options []vmess.ClientOption + if option.GlobalPadding { + options = append(options, vmess.ClientWithGlobalPadding()) + } if option.AuthenticatedLength { options = append(options, vmess.ClientWithAuthenticatedLength()) }