Skip to content

Commit 022605b

Browse files
committed
Actually dial the sp3 server
1 parent 176845e commit 022605b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ _testmain.go
2424
*.prof
2525

2626
/server/server
27+
/examples/echo/echo

examples/echo/main.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/google/gopacket/layers"
1212
"github.com/willscott/goturn/client"
1313
"github.com/willscott/sp3"
14+
"log"
1415
"net"
1516
"net/url"
1617
"os"
@@ -41,10 +42,12 @@ func main() {
4142
panic(err)
4243
}
4344

44-
u := url.URL{}
45+
base := url.URL{}
46+
u, _ := base.Parse(*server)
47+
log.Printf("Connecting to SP3 at: %v", u)
4548

4649
// Create a connection to the server
47-
conn, err := sp3.Dial(u, udpAddr.IP, sp3.DirectAuth{}, nil)
50+
conn, err := sp3.Dial(*u, udpAddr.IP, sp3.DirectAuth{}, nil)
4851
if err != nil {
4952
panic(err)
5053
}

0 commit comments

Comments
 (0)