Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
chore: update go-libp2p-transport-upgrader and go-libp2p-core
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Jul 24, 2021
1 parent 666bbbe commit 9a4184a
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 66 deletions.
16 changes: 13 additions & 3 deletions browser_integration_browser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,32 @@ import (
"testing"
"time"

"github.com/libp2p/go-libp2p-core/sec/insecure"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/test"
mplex "github.com/libp2p/go-libp2p-mplex"
tptu "github.com/libp2p/go-libp2p-transport-upgrader"
ma "github.com/multiformats/go-multiaddr"
)

func TestInBrowser(t *testing.T) {
priv, _, err := test.RandTestKeyPair(crypto.Ed25519, 256)
if err != nil {
t.Fatal(err)
}
id, err := peer.IDFromPrivateKey(priv)
if err != nil {
t.Fatal(err)
}
tpt := New(&tptu.Upgrader{
Secure: insecure.New("browserPeer"),
Secure: newSecureMuxer(t, id),
Muxer: new(mplex.Transport),
})
addr, err := ma.NewMultiaddr("/ip4/127.0.0.1/tcp/5555/ws")
if err != nil {
t.Fatal("could not parse multiaddress:" + err.Error())
}
conn, err := tpt.Dial(context.Background(), addr, "serverPeer")
conn, err := tpt.Dial(context.Background(), addr, id)
if err != nil {
t.Fatal("could not dial server:" + err.Error())
}
Expand Down
3 changes: 1 addition & 2 deletions browser_integration_native_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"strings"
"testing"

"github.com/libp2p/go-libp2p-core/sec/insecure"
mplex "github.com/libp2p/go-libp2p-mplex"
tptu "github.com/libp2p/go-libp2p-transport-upgrader"
ma "github.com/multiformats/go-multiaddr"
Expand Down Expand Up @@ -53,7 +52,7 @@ func TestInBrowser(t *testing.T) {
close(serverDoneSignal)
}()
tpt := New(&tptu.Upgrader{
Secure: insecure.New("serverPeer"),
Secure: newSecureMuxer(t, "serverPeer"),
Muxer: new(mplex.Transport),
})
addr, err := ma.NewMultiaddr("/ip4/127.0.0.1/tcp/5555/ws")
Expand Down
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ module github.com/libp2p/go-ws-transport

require (
github.com/gorilla/websocket v1.4.2
github.com/libp2p/go-libp2p-core v0.8.0
github.com/libp2p/go-libp2p-mplex v0.4.0
github.com/libp2p/go-conn-security-multistream v0.2.1
github.com/libp2p/go-libp2p-core v0.9.0
github.com/libp2p/go-libp2p-mplex v0.4.1
github.com/libp2p/go-libp2p-testing v0.4.0
github.com/libp2p/go-libp2p-transport-upgrader v0.2.0
github.com/libp2p/go-libp2p-transport-upgrader v0.4.3
github.com/multiformats/go-multiaddr v0.3.3
github.com/multiformats/go-multiaddr-fmt v0.1.0
)
Expand Down
Loading

0 comments on commit 9a4184a

Please sign in to comment.