Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dtls multiaddr #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions multiaddr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func TestConstructSucceeds(t *testing.T) {
"/onion/timaq4ygg2iegci7:1234",
"/onion/timaq4ygg2iegci7:80/http",
"/udp/0",
"/dtls",
"/tcp/0",
"/sctp/0",
"/udp/1234",
Expand All @@ -84,6 +85,7 @@ func TestConstructSucceeds(t *testing.T) {
"/tcp/65535",
"/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC",
"/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC",
"/udp/1234/dtls",
"/udp/1234/sctp/1234",
"/udp/1234/udt",
"/udp/1234/utp",
Expand All @@ -93,6 +95,7 @@ func TestConstructSucceeds(t *testing.T) {
"/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC/tcp/1234",
"/ip4/127.0.0.1/udp/1234",
"/ip4/127.0.0.1/udp/0",
"/ip4/127.0.0.1/udp/1234/dtls",
"/ip4/127.0.0.1/tcp/1234",
"/ip4/127.0.0.1/tcp/1234/",
"/ip4/127.0.0.1/udp/1234/quic",
Expand Down
7 changes: 7 additions & 0 deletions protocols.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const (
P_IP4 = 0x0004
P_TCP = 0x0006
P_UDP = 0x0111
P_DTLS = 0x0020
P_DCCP = 0x0021
P_IP6 = 0x0029
P_IP6ZONE = 0x002A
Expand Down Expand Up @@ -49,6 +50,11 @@ var (
Path: false,
Transcoder: TranscoderPort,
}
protoDTLS = Protocol{
Name: "dtls",
Code: P_DTLS,
VCode: CodeToVarint(P_DTLS),
}
protoDCCP = Protocol{
Name: "dccp",
Code: P_DCCP,
Expand Down Expand Up @@ -134,6 +140,7 @@ func init() {
protoIP4,
protoTCP,
protoUDP,
protoDTLS,
protoDCCP,
protoIP6,
protoIP6ZONE,
Expand Down