1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-04 23:40:26 +08:00

feat: split udp protocol to folder p2p

This commit is contained in:
源文雨
2024-07-14 22:26:44 +09:00
parent 4a8e848673
commit 32af3ce142
16 changed files with 180 additions and 49 deletions

View File

@@ -8,6 +8,8 @@ import (
"github.com/sirupsen/logrus"
_ "github.com/fumiama/WireGold/gold/p2p/udp" // support udp connection
"github.com/fumiama/WireGold/gold/head"
"github.com/fumiama/WireGold/gold/link"
)

View File

@@ -9,6 +9,8 @@ import (
curve "github.com/fumiama/go-x25519"
"github.com/sirupsen/logrus"
_ "github.com/fumiama/WireGold/gold/p2p/udp" // support udp connection
"github.com/fumiama/WireGold/config"
"github.com/fumiama/WireGold/gold/link"
"github.com/fumiama/WireGold/helper"
@@ -93,6 +95,7 @@ func (wg *WG) init(srcport, dstport uint16) {
wg.me = link.NewMe(&link.MyConfig{
MyIPwithMask: wg.c.IP + "/32",
MyEndpoint: wg.c.EndPoint,
Network: wg.c.Network,
PrivateKey: &wg.key,
NIC: lower.NewNIC(wg.c.IP, wg.c.SubNet, strconv.FormatInt(wg.c.MTU, 10), cidrs...),
SrcPort: srcport,