1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-05 07:50:24 +08:00

feat(p2p): ip support configs

This commit is contained in:
源文雨
2024-07-18 02:04:34 +09:00
parent 28c388aca9
commit 5ff8d27fe4

View File

@@ -14,6 +14,9 @@ func NewEndpoint(endpoint string, configs ...any) (p2p.EndPoint, error) {
return nil, err
}
ptcl := uint(0x04) // IPIP
if len(configs) > 0 {
ptcl = configs[0].(uint)
}
return &EndPoint{
addr: &net.IPAddr{
IP: addr.AsSlice(),