1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 09:36:34 -05:00

Add VLite Client Support for Packet Armor

This commit is contained in:
Shelikhoo 2022-04-13 23:30:53 +01:00 committed by Xiaokang Wang (Shelikhoo)
parent dae391fa41
commit 322c8cc663
2 changed files with 6 additions and 0 deletions

View File

@ -20,4 +20,5 @@ message UDPProtocolConfig {
bool enable_fec = 5;
bool enable_stabilization = 6;
bool enable_renegotiation = 7;
uint32 handshake_masking_padding_size = 8;
}

View File

@ -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)