Skip to content

Commit f9a2178

Browse files
committed
tun/netstack: bump deps and api
Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 5ba931b commit f9a2178

File tree

5 files changed

+256
-40
lines changed

5 files changed

+256
-40
lines changed

tun/netstack/examples/http_client.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"net"
1414
"net/http"
1515

16+
"golang.zx2c4.com/wireguard/conn"
1617
"golang.zx2c4.com/wireguard/device"
1718
"golang.zx2c4.com/wireguard/tun/netstack"
1819
)
@@ -25,7 +26,7 @@ func main() {
2526
if err != nil {
2627
log.Panic(err)
2728
}
28-
dev := device.NewDevice(tun, &device.Logger{log.Default(), log.Default(), log.Default()})
29+
dev := device.NewDevice(tun, conn.NewDefaultBind(), device.NewLogger(device.LogLevelVerbose, ""))
2930
dev.IpcSet(`private_key=a8dac1d8a70a751f0f699fb14ba1cff7b79cf4fbd8f09f44c6e6a90d0369604f
3031
public_key=25123c5dcd3328ff645e4f2a3fce0d754400d3887a0cb7c56f0267e20fbf3c5b
3132
endpoint=163.172.161.0:12912

tun/netstack/examples/http_server.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
package main
99

1010
import (
11-
"golang.zx2c4.com/wireguard/device"
12-
"golang.zx2c4.com/wireguard/tun/netstack"
1311
"io"
1412
"log"
1513
"net"
1614
"net/http"
15+
16+
"golang.zx2c4.com/wireguard/conn"
17+
"golang.zx2c4.com/wireguard/device"
18+
"golang.zx2c4.com/wireguard/tun/netstack"
1719
)
1820

1921
func main() {
@@ -25,13 +27,13 @@ func main() {
2527
if err != nil {
2628
log.Panic(err)
2729
}
28-
dev := device.NewDevice(tun, &device.Logger{log.Default(), log.Default(), log.Default()})
30+
dev := device.NewDevice(tun, conn.NewDefaultBind(), device.NewLogger(device.LogLevelVerbose, ""))
2931
dev.IpcSet(`private_key=a8dac1d8a70a751f0f699fb14ba1cff7b79cf4fbd8f09f44c6e6a90d0369604f
3032
public_key=25123c5dcd3328ff645e4f2a3fce0d754400d3887a0cb7c56f0267e20fbf3c5b
3133
endpoint=163.172.161.0:12912
3234
allowed_ip=0.0.0.0/0
3335
persistent_keepalive_interval=25
34-
`)
36+
`)
3537
dev.Up()
3638
listener, err := tnet.ListenTCP(&net.TCPAddr{Port: 80})
3739
if err != nil {

tun/netstack/go.mod

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
module golang.zx2c4.com/wireguard/tun/netstack
22

3-
go 1.15
3+
go 1.16
44

55
require (
6-
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b
7-
golang.zx2c4.com/wireguard v0.0.20201118
8-
gvisor.dev/gvisor v0.0.0-20210109011639-2fb7a49fea98
6+
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
7+
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b // indirect
8+
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
9+
golang.zx2c4.com/wireguard v0.0.0-20210305220617-63240841d392
10+
gvisor.dev/gvisor v0.0.0-20210306005637-a64c3a1b5a9f
911
)

0 commit comments

Comments
 (0)