diff --git a/proxy/vlite/outbound/config.proto b/proxy/vlite/outbound/config.proto index be06b34f6..4319a2d3c 100644 --- a/proxy/vlite/outbound/config.proto +++ b/proxy/vlite/outbound/config.proto @@ -20,4 +20,5 @@ message UDPProtocolConfig { bool enable_fec = 5; bool enable_stabilization = 6; bool enable_renegotiation = 7; + uint32 handshake_masking_padding_size = 8; } \ No newline at end of file diff --git a/proxy/vlite/outbound/outbound.go b/proxy/vlite/outbound/outbound.go index 92e736bdf..fc49fa594 100644 --- a/proxy/vlite/outbound/outbound.go +++ b/proxy/vlite/outbound/outbound.go @@ -130,6 +130,11 @@ func createStatusFromConfig(config *UDPProtocolConfig) (*status, error) { ctx = context.WithValue(ctx, interfaces.ExtraOptionsUDPMask, string(s.password)) + if config.HandshakeMaskingPaddingSize != 0 { + ctxv := &interfaces.ExtraOptionsUsePacketArmorValue{PacketArmorPaddingTo: int(config.HandshakeMaskingPaddingSize), UsePacketArmor: true} + ctx = context.WithValue(ctx, interfaces.ExtraOptionsUsePacketArmor, ctxv) + } + destinationString := fmt.Sprintf("%v:%v", config.Address.AsAddress().String(), config.Port) s.udpdialer = udpClient.NewUdpClient(destinationString, ctx)