mirror of
https://github.com/vacp2p/nim-libp2p.git
synced 2025-01-13 18:27:10 +00:00
b37133ca43
Our quic effort is blocked by bearssl not supporting TLS1.3, but since Mark did most of the work to implement Quic here: https://github.com/status-im/nim-libp2p/pull/563 and on nim-quic, this PR is going to bring encryption-less Quic into nim-libp2p This allows us to test it, and make sure it doesn't bitrot. Heavily WiP: - [X] Extract code from #563 - [X] Create custom muxer & upgrader - [X] Basic E2E switch test working - [x] Update nim-quic to get address informations in libp2p (for `observed address` and port 0 resolving) - [ ] More tests - [ ] Cleanup Since encryption is not yet supported, we're not compatible with any other libp2ps, and have to rely on home made protocols to retrieve the peer's id --------- Co-authored-by: markspanbroek <mark@spanbroek.net> Co-authored-by: Diego <diego@status.im>
25 lines
554 B
Nim
25 lines
554 B
Nim
{.used.}
|
|
|
|
import sequtils
|
|
import chronos, stew/byteutils
|
|
import
|
|
../libp2p/[
|
|
stream/connection,
|
|
transports/transport,
|
|
transports/quictransport,
|
|
upgrademngrs/upgrade,
|
|
multiaddress,
|
|
errors,
|
|
wire,
|
|
]
|
|
|
|
import ./helpers, ./commontransport
|
|
|
|
suite "Quic transport":
|
|
asyncTest "can handle local address":
|
|
let ma = @[MultiAddress.init("/ip4/127.0.0.1/udp/0/quic-v1").tryGet()]
|
|
let transport1 = QuicTransport.new()
|
|
await transport1.start(ma)
|
|
check transport1.handles(transport1.addrs[0])
|
|
await transport1.stop()
|