mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-13 13:40:30 +08:00
feat(p2p): ip support configs
This commit is contained in:
@@ -14,6 +14,9 @@ func NewEndpoint(endpoint string, configs ...any) (p2p.EndPoint, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
ptcl := uint(0x04) // IPIP
|
ptcl := uint(0x04) // IPIP
|
||||||
|
if len(configs) > 0 {
|
||||||
|
ptcl = configs[0].(uint)
|
||||||
|
}
|
||||||
return &EndPoint{
|
return &EndPoint{
|
||||||
addr: &net.IPAddr{
|
addr: &net.IPAddr{
|
||||||
IP: addr.AsSlice(),
|
IP: addr.AsSlice(),
|
||||||
|
|||||||
Reference in New Issue
Block a user