mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-01-06 01:23:38 +08:00
feat: Add VMess global padding support
This commit is contained in:
parent
35506e179a
commit
59edcf33bd
@ -54,6 +54,7 @@ type VmessOption struct {
|
|||||||
PacketAddr bool `proxy:"packet-addr,omitempty"`
|
PacketAddr bool `proxy:"packet-addr,omitempty"`
|
||||||
XUDP bool `proxy:"xudp,omitempty"`
|
XUDP bool `proxy:"xudp,omitempty"`
|
||||||
PacketEncoding string `proxy:"packet-encoding,omitempty"`
|
PacketEncoding string `proxy:"packet-encoding,omitempty"`
|
||||||
|
GlobalPadding bool `proxy:"global-padding,omitempty"`
|
||||||
AuthenticatedLength bool `proxy:"authenticated-length,omitempty"`
|
AuthenticatedLength bool `proxy:"authenticated-length,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,6 +312,9 @@ func (v *Vmess) SupportUOT() bool {
|
|||||||
func NewVmess(option VmessOption) (*Vmess, error) {
|
func NewVmess(option VmessOption) (*Vmess, error) {
|
||||||
security := strings.ToLower(option.Cipher)
|
security := strings.ToLower(option.Cipher)
|
||||||
var options []vmess.ClientOption
|
var options []vmess.ClientOption
|
||||||
|
if option.GlobalPadding {
|
||||||
|
options = append(options, vmess.ClientWithGlobalPadding())
|
||||||
|
}
|
||||||
if option.AuthenticatedLength {
|
if option.AuthenticatedLength {
|
||||||
options = append(options, vmess.ClientWithAuthenticatedLength())
|
options = append(options, vmess.ClientWithAuthenticatedLength())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user