From ff9493190f721c925c14b32f289610c1fbaa2032 Mon Sep 17 00:00:00 2001 From: diegomrsantos Date: Mon, 20 Nov 2023 11:09:56 +0100 Subject: [PATCH] fix(multiaddress): add quic-v1 multiaddress support (#988) --- libp2p/multiaddress.nim | 3 +++ libp2p/multicodec.nim | 1 + tests/testmultiaddress.nim | 1 + 3 files changed, 5 insertions(+) diff --git a/libp2p/multiaddress.nim b/libp2p/multiaddress.nim index 02f5c4803..f45276848 100644 --- a/libp2p/multiaddress.nim +++ b/libp2p/multiaddress.nim @@ -398,6 +398,9 @@ const MAProtocol( mcodec: multiCodec("quic"), kind: Marker, size: 0 ), + MAProtocol( + mcodec: multiCodec("quic-v1"), kind: Marker, size: 0 + ), MAProtocol( mcodec: multiCodec("ip6zone"), kind: Length, size: 0, coder: TranscoderIP6Zone diff --git a/libp2p/multicodec.nim b/libp2p/multicodec.nim index 184da5712..a873e5fd5 100644 --- a/libp2p/multicodec.nim +++ b/libp2p/multicodec.nim @@ -193,6 +193,7 @@ const MultiCodecList = [ ("https", 0x01BB), ("tls", 0x01C0), ("quic", 0x01CC), + ("quic-v1", 0x01CD), ("ws", 0x01DD), ("wss", 0x01DE), ("p2p-websocket-star", 0x01DF), # not in multicodec list diff --git a/tests/testmultiaddress.nim b/tests/testmultiaddress.nim index 025909e48..0df4d6464 100644 --- a/tests/testmultiaddress.nim +++ b/tests/testmultiaddress.nim @@ -60,6 +60,7 @@ const "/ip4/127.0.0.1/tcp/1234", "/ip4/127.0.0.1/tcp/1234/", "/ip4/127.0.0.1/udp/1234/quic", + "/ip4/192.168.80.3/udp/33422/quic-v1", "/ip4/127.0.0.1/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC", "/ip4/127.0.0.1/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC/tcp/1234", "/ip4/127.0.0.1/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC",