Skip to content

Commit

Permalink
new: add support for warp in wiregaurd mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Mar 2, 2025
1 parent 1134557 commit 699f559
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion ray2sing/wireguard.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func WiregaurdSingbox(url string) (*T.Outbound, error) {
fake_packet_mode := u.Params["ifpm"]
if wnoise, ok := u.Params["wnoise"]; ok {
switch wnoise {
case "quick":
case "quic":
fake_packet_mode = "m4"
}
}
Expand Down Expand Up @@ -98,5 +98,23 @@ func WiregaurdSingbox(url string) (*T.Outbound, error) {
}
}

if out.WireGuardOptions.PrivateKey == "" { //it is warp
return &T.Outbound{
Type: "custom",
Tag: u.Name,
CustomOptions: map[string]interface{}{
"warp": map[string]interface{}{
"key": u.Username,
"host": out.WireGuardOptions.ServerOptions.Server,
"port": out.WireGuardOptions.ServerOptions.ServerPort,
"fake_packets": out.WireGuardOptions.FakePackets,
"fake_packets_size": out.WireGuardOptions.FakePacketsSize,
"fake_packets_delay": out.WireGuardOptions.FakePacketsDelay,
"fake_packets_mode": out.WireGuardOptions.FakePacketsMode,
},
},
}, nil
}

return out, nil
}

0 comments on commit 699f559

Please sign in to comment.