Skip to content

Commit

Permalink
Merge pull request #52 from libp2p/fix/global-multiaddr-registry
Browse files Browse the repository at this point in the history
move multiaddr protocol definitions to go-multiaddr
  • Loading branch information
Stebalien authored Sep 19, 2019
2 parents 3255249 + 7b972a0 commit 44c0579
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions p2p/transport/websocket/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package websocket

import (
"context"
"fmt"
"net"
"net/http"
"net/url"
Expand All @@ -20,11 +19,9 @@ import (
)

// WsProtocol is the multiaddr protocol definition for this transport.
var WsProtocol = ma.Protocol{
Code: 477,
Name: "ws",
VCode: ma.CodeToVarint(477),
}
//
// Deprecated: use `ma.ProtocolWithCode(ma.P_WS)
var WsProtocol = ma.ProtocolWithCode(ma.P_WS)

// WsFmt is multiaddr formatter for WsProtocol
var WsFmt = mafmt.And(mafmt.TCP, mafmt.Base(WsProtocol.Code))
Expand All @@ -46,11 +43,6 @@ var upgrader = ws.Upgrader{
}

func init() {
err := ma.AddProtocol(WsProtocol)
if err != nil {
panic(fmt.Errorf("error registering websocket protocol: %s", err))
}

manet.RegisterNetCodec(WsCodec)
}

Expand Down

0 comments on commit 44c0579

Please sign in to comment.