Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-swarm
Commits
ed8b46d4
Commit
ed8b46d4
authored
May 16, 2016
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add in experimental websocket support
parent
230a36bd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
0 deletions
+7
-0
addr/addr.go
addr/addr.go
+4
-0
addr/addr_test.go
addr/addr_test.go
+1
-0
swarm.go
swarm.go
+2
-0
No files found.
addr/addr.go
View file @
ed8b46d4
...
@@ -7,6 +7,8 @@ import (
...
@@ -7,6 +7,8 @@ import (
ma
"github.com/jbenet/go-multiaddr"
ma
"github.com/jbenet/go-multiaddr"
manet
"github.com/jbenet/go-multiaddr-net"
manet
"github.com/jbenet/go-multiaddr-net"
context
"golang.org/x/net/context"
context
"golang.org/x/net/context"
_
"github.com/whyrusleeping/ws-transport"
)
)
var
log
=
logging
.
Logger
(
"github.com/libp2p/go-libp2p/p2p/net/swarm/addr"
)
var
log
=
logging
.
Logger
(
"github.com/libp2p/go-libp2p/p2p/net/swarm/addr"
)
...
@@ -19,6 +21,8 @@ var SupportedTransportStrings = []string{
...
@@ -19,6 +21,8 @@ var SupportedTransportStrings = []string{
"/ip6/tcp"
,
"/ip6/tcp"
,
"/ip4/udp/utp"
,
"/ip4/udp/utp"
,
"/ip6/udp/utp"
,
"/ip6/udp/utp"
,
"/ip4/tcp/ws"
,
"/ip6/tcp/ws"
,
// "/ip4/udp/udt", disabled because the lib doesnt work on arm
// "/ip4/udp/udt", disabled because the lib doesnt work on arm
// "/ip6/udp/udt", disabled because the lib doesnt work on arm
// "/ip6/udp/udt", disabled because the lib doesnt work on arm
}
}
...
...
addr/addr_test.go
View file @
ed8b46d4
...
@@ -29,6 +29,7 @@ func TestFilterAddrs(t *testing.T) {
...
@@ -29,6 +29,7 @@ func TestFilterAddrs(t *testing.T) {
newMultiaddr
(
t
,
"/ip4/127.0.0.1/tcp/1234"
),
newMultiaddr
(
t
,
"/ip4/127.0.0.1/tcp/1234"
),
newMultiaddr
(
t
,
"/ip6/::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/udp/1234/utp"
),
newMultiaddr
(
t
,
"/ip4/1.2.3.4/tcp/1234/ws"
),
}
}
goodAndBad
:=
append
(
good
,
bad
...
)
goodAndBad
:=
append
(
good
,
bad
...
)
...
...
swarm.go
View file @
ed8b46d4
...
@@ -29,6 +29,7 @@ import (
...
@@ -29,6 +29,7 @@ import (
spdy
"github.com/whyrusleeping/go-smux-spdystream"
spdy
"github.com/whyrusleeping/go-smux-spdystream"
yamux
"github.com/whyrusleeping/go-smux-yamux"
yamux
"github.com/whyrusleeping/go-smux-yamux"
mafilter
"github.com/whyrusleeping/multiaddr-filter"
mafilter
"github.com/whyrusleeping/multiaddr-filter"
ws
"github.com/whyrusleeping/ws-transport"
context
"golang.org/x/net/context"
context
"golang.org/x/net/context"
)
)
...
@@ -120,6 +121,7 @@ func NewSwarm(ctx context.Context, listenAddrs []ma.Multiaddr,
...
@@ -120,6 +121,7 @@ func NewSwarm(ctx context.Context, listenAddrs []ma.Multiaddr,
transports
:
[]
transport
.
Transport
{
transports
:
[]
transport
.
Transport
{
transport
.
NewTCPTransport
(),
transport
.
NewTCPTransport
(),
transport
.
NewUtpTransport
(),
transport
.
NewUtpTransport
(),
new
(
ws
.
WebsocketTransport
),
},
},
bwc
:
bwc
,
bwc
:
bwc
,
fdRateLimit
:
make
(
chan
struct
{},
concurrentFdDials
),
fdRateLimit
:
make
(
chan
struct
{},
concurrentFdDials
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment