Browse Source

add WebTransport to the list of default transports (#1915)

identify-remove-delta
Marten Seemann 2 years ago
committed by GitHub
parent
commit
c67d4b86e4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      defaults.go

4
defaults.go

@ -15,6 +15,7 @@ import (
quic "github.com/libp2p/go-libp2p/p2p/transport/quic"
"github.com/libp2p/go-libp2p/p2p/transport/tcp"
ws "github.com/libp2p/go-libp2p/p2p/transport/websocket"
webtransport "github.com/libp2p/go-libp2p/p2p/transport/webtransport"
"github.com/multiformats/go-multiaddr"
madns "github.com/multiformats/go-multiaddr-dns"
@ -43,6 +44,7 @@ var DefaultTransports = ChainOptions(
Transport(tcp.NewTCPTransport),
Transport(quic.NewTransport),
Transport(ws.New),
Transport(webtransport.New),
)
// DefaultPrivateTransports are the default libp2p transports when a PSK is supplied.
@ -78,9 +80,11 @@ var DefaultListenAddrs = func(cfg *Config) error {
"/ip4/0.0.0.0/tcp/0",
"/ip4/0.0.0.0/udp/0/quic",
"/ip4/0.0.0.0/udp/0/quic-v1",
"/ip4/0.0.0.0/udp/0/quic-v1/webtransport",
"/ip6/::/tcp/0",
"/ip6/::/udp/0/quic",
"/ip6/::/udp/0/quic-v1",
"/ip6/::/udp/0/quic-v1/webtransport",
}
listenAddrs := make([]multiaddr.Multiaddr, 0, len(addrs))
for _, s := range addrs {

Loading…
Cancel
Save