1
0
mirror of https://github.com/fumiama/WireGold.git synced 2026-06-10 11:40:30 +08:00

完善路由表

This commit is contained in:
fumiama
2021-12-28 15:47:21 +08:00
parent a9abad93d3
commit c707e4d90a
7 changed files with 71 additions and 14 deletions

View File

@@ -28,9 +28,9 @@ func TestTunnel(t *testing.T) {
t.Log("peer publ key:", hex.EncodeToString(peerpk.Public()[:]))
m := link.NewMe(selfpk.Private(), "192.168.1.2", "127.0.0.1:1236")
m.AddPeer("192.168.1.3", peerpk.Public(), "127.0.0.1:1237", nil, 0, false)
m.AddPeer("192.168.1.3", peerpk.Public(), "127.0.0.1:1237", []string{"192.168.1.3/32"}, 0, false)
p := link.NewMe(peerpk.Private(), "192.168.1.3", "127.0.0.1:1237")
p.AddPeer("192.168.1.2", selfpk.Public(), "127.0.0.1:1236", nil, 0, false)
p.AddPeer("192.168.1.2", selfpk.Public(), "127.0.0.1:1236", []string{"192.168.1.2/32"}, 0, false)
tunnme, err := Create(&m, "192.168.1.3", 1, 1, 4096)
if err != nil {
t.Fatal(err)