Commit b1456b79 authored by Jeromy's avatar Jeromy
Browse files

add in experimental websocket support

parent 7ac44bb2
......@@ -7,6 +7,8 @@ import (
ma "github.com/jbenet/go-multiaddr"
manet "github.com/jbenet/go-multiaddr-net"
context "golang.org/x/net/context"
_ "github.com/whyrusleeping/ws-transport"
)
var log = logging.Logger("github.com/libp2p/go-libp2p/p2p/net/swarm/addr")
......@@ -19,6 +21,8 @@ var SupportedTransportStrings = []string{
"/ip6/tcp",
"/ip4/udp/utp",
"/ip6/udp/utp",
"/ip4/tcp/ws",
"/ip6/tcp/ws",
// "/ip4/udp/udt", disabled because the lib doesnt work on arm
// "/ip6/udp/udt", disabled because the lib doesnt work on arm
}
......
......@@ -29,6 +29,7 @@ func TestFilterAddrs(t *testing.T) {
newMultiaddr(t, "/ip4/127.0.0.1/tcp/1234"),
newMultiaddr(t, "/ip6/::1/tcp/1234"),
newMultiaddr(t, "/ip4/1.2.3.4/udp/1234/utp"),
newMultiaddr(t, "/ip4/1.2.3.4/tcp/1234/ws"),
}
goodAndBad := append(good, bad...)
......
......@@ -29,6 +29,7 @@ import (
spdy "github.com/whyrusleeping/go-smux-spdystream"
yamux "github.com/whyrusleeping/go-smux-yamux"
mafilter "github.com/whyrusleeping/multiaddr-filter"
ws "github.com/whyrusleeping/ws-transport"
context "golang.org/x/net/context"
)
......@@ -120,6 +121,7 @@ func NewSwarm(ctx context.Context, listenAddrs []ma.Multiaddr,
transports: []transport.Transport{
transport.NewTCPTransport(),
transport.NewUtpTransport(),
new(ws.WebsocketTransport),
},
bwc: bwc,
fdRateLimit: make(chan struct{}, concurrentFdDials),
......
......@@ -186,6 +186,12 @@
"hash": "QmSZi9ygLohBUGyHMqE5N6eToPwqcg7bZQTULeVLFu7Q6d",
"name": "go-libp2p-peerstore",
"version": "1.2.2"
},
{
"author": "whyrusleeping",
"hash": "QmU6T64asAHorS9vUT2LQtCt6mxNpynxL3LXWBtc3tqiB4",
"name": "ws-transport",
"version": "1.0.5"
}
],
"gxVersion": "0.4.0",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment