@moq/net 0.4.8 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/announce.d.ts +1 -1
- package/announce.d.ts.map +1 -1
- package/announce.js +1 -1
- package/announce.js.map +1 -1
- package/announced.d.ts +51 -47
- package/announced.d.ts.map +1 -1
- package/announced.js +183 -31
- package/announced.js.map +1 -1
- package/announced.test-util.d.ts +2 -0
- package/announced.test-util.d.ts.map +1 -0
- package/announced.test-util.js +27 -0
- package/announced.test-util.js.map +1 -0
- package/auth.d.ts +64 -0
- package/auth.d.ts.map +1 -0
- package/auth.js +20 -0
- package/auth.js.map +1 -0
- package/auth_gate.d.ts +2 -0
- package/auth_gate.d.ts.map +1 -0
- package/auth_gate.js +24 -0
- package/auth_gate.js.map +1 -0
- package/auth_session.d.ts +49 -0
- package/auth_session.d.ts.map +1 -0
- package/auth_session.js +1097 -0
- package/auth_session.js.map +1 -0
- package/bandwidth.d.ts +129 -25
- package/bandwidth.d.ts.map +1 -1
- package/bandwidth.js +410 -138
- package/bandwidth.js.map +1 -1
- package/bandwidth_api.d.ts +1 -1
- package/bandwidth_api.d.ts.map +1 -1
- package/bandwidth_api.js +1 -1
- package/bandwidth_api.js.map +1 -1
- package/broadcast.d.ts +62 -36
- package/broadcast.d.ts.map +1 -1
- package/broadcast.js +556 -172
- package/broadcast.js.map +1 -1
- package/cache.d.ts +103 -0
- package/cache.d.ts.map +1 -0
- package/cache.js +254 -0
- package/cache.js.map +1 -0
- package/claim.test-util.d.ts +5 -0
- package/claim.test-util.d.ts.map +1 -0
- package/claim.test-util.js +13 -0
- package/claim.test-util.js.map +1 -0
- package/connection/accept.d.ts +20 -12
- package/connection/accept.d.ts.map +1 -1
- package/connection/accept.js +97 -129
- package/connection/accept.js.map +1 -1
- package/connection/browser.d.ts.map +1 -1
- package/connection/browser.js +28 -19
- package/connection/browser.js.map +1 -1
- package/connection/connect.d.ts +119 -23
- package/connection/connect.d.ts.map +1 -1
- package/connection/connect.js +535 -216
- package/connection/connect.js.map +1 -1
- package/connection/dials.d.ts +45 -0
- package/connection/dials.d.ts.map +1 -0
- package/connection/dials.js +109 -0
- package/connection/dials.js.map +1 -0
- package/connection/endpoint.d.ts +60 -0
- package/connection/endpoint.d.ts.map +1 -0
- package/connection/endpoint.js +114 -0
- package/connection/endpoint.js.map +1 -0
- package/connection/forward.d.ts +7 -1
- package/connection/forward.d.ts.map +1 -1
- package/connection/forward.js +265 -80
- package/connection/forward.js.map +1 -1
- package/connection/goaway.d.ts +16 -9
- package/connection/goaway.d.ts.map +1 -1
- package/connection/goaway.js +22 -108
- package/connection/goaway.js.map +1 -1
- package/connection/handshake.d.ts +32 -6
- package/connection/handshake.d.ts.map +1 -1
- package/connection/handshake.js +97 -20
- package/connection/handshake.js.map +1 -1
- package/connection/index.d.ts +3 -6
- package/connection/index.d.ts.map +1 -1
- package/connection/index.js +1 -2
- package/connection/index.js.map +1 -1
- package/connection/liveness.d.ts +14 -0
- package/connection/liveness.d.ts.map +1 -0
- package/connection/liveness.js +30 -0
- package/connection/liveness.js.map +1 -0
- package/connection/pool.d.ts +137 -58
- package/connection/pool.d.ts.map +1 -1
- package/connection/pool.js +281 -117
- package/connection/pool.js.map +1 -1
- package/connection/reload.d.ts +60 -12
- package/connection/reload.d.ts.map +1 -1
- package/connection/reload.js +859 -233
- package/connection/reload.js.map +1 -1
- package/connection/session.d.ts +91 -0
- package/connection/session.d.ts.map +1 -0
- package/connection/session.js +2 -0
- package/connection/session.js.map +1 -0
- package/connection/stats.d.ts +20 -11
- package/connection/stats.d.ts.map +1 -1
- package/connection/stats.js +64 -8
- package/connection/stats.js.map +1 -1
- package/connection/ticker.d.ts +4 -0
- package/connection/ticker.d.ts.map +1 -0
- package/connection/ticker.js +66 -0
- package/connection/ticker.js.map +1 -0
- package/connection/tokens.d.ts +2 -0
- package/connection/tokens.d.ts.map +1 -0
- package/connection/tokens.js +404 -0
- package/connection/tokens.js.map +1 -0
- package/connection/transport.d.ts.map +1 -1
- package/connection/transport.js +4 -4
- package/connection/transport.js.map +1 -1
- package/connection/withdrawal.d.ts +2 -0
- package/connection/withdrawal.d.ts.map +1 -0
- package/connection/withdrawal.js +23 -0
- package/connection/withdrawal.js.map +1 -0
- package/consume.js +213 -46
- package/consume.js.map +1 -1
- package/cover.d.ts +59 -0
- package/cover.d.ts.map +1 -0
- package/cover.js +375 -0
- package/cover.js.map +1 -0
- package/datagram.d.ts +70 -11
- package/datagram.d.ts.map +1 -1
- package/datagram.js +317 -1
- package/datagram.js.map +1 -1
- package/datagram_stream.d.ts +18 -0
- package/datagram_stream.d.ts.map +1 -0
- package/datagram_stream.js +67 -0
- package/datagram_stream.js.map +1 -0
- package/defined.test-util.d.ts +2 -0
- package/defined.test-util.d.ts.map +1 -0
- package/defined.test-util.js +7 -0
- package/defined.test-util.js.map +1 -0
- package/delivered.d.ts +75 -0
- package/delivered.d.ts.map +1 -0
- package/delivered.js +228 -0
- package/delivered.js.map +1 -0
- package/demand.d.ts +173 -0
- package/demand.d.ts.map +1 -0
- package/demand.js +582 -0
- package/demand.js.map +1 -0
- package/drops.d.ts +93 -0
- package/drops.d.ts.map +1 -0
- package/drops.js +283 -0
- package/drops.js.map +1 -0
- package/error.d.ts +120 -21
- package/error.d.ts.map +1 -1
- package/error.js +230 -37
- package/error.js.map +1 -1
- package/errors.d.ts +2 -2
- package/errors.d.ts.map +1 -1
- package/errors.js +2 -2
- package/errors.js.map +1 -1
- package/fill.d.ts +174 -0
- package/fill.d.ts.map +1 -0
- package/fill.js +760 -0
- package/fill.js.map +1 -0
- package/flate/decoder.d.ts +2 -0
- package/flate/decoder.d.ts.map +1 -0
- package/flate/decoder.js +63 -0
- package/flate/decoder.js.map +1 -0
- package/flate/encoder.d.ts +2 -0
- package/flate/encoder.d.ts.map +1 -0
- package/flate/encoder.js +64 -0
- package/flate/encoder.js.map +1 -0
- package/flate/group.d.ts +34 -0
- package/flate/group.d.ts.map +1 -0
- package/flate/group.js +140 -0
- package/flate/group.js.map +1 -0
- package/frame.d.ts +80 -0
- package/frame.d.ts.map +1 -0
- package/frame.js +296 -0
- package/frame.js.map +1 -0
- package/frame.test-util.d.ts +5 -0
- package/frame.test-util.d.ts.map +1 -0
- package/frame.test-util.js +9 -0
- package/frame.test-util.js.map +1 -0
- package/group.d.ts +108 -45
- package/group.d.ts.map +1 -1
- package/group.js +1616 -307
- package/group.js.map +1 -1
- package/group_api.d.ts +7 -0
- package/group_api.d.ts.map +1 -0
- package/group_api.js +7 -0
- package/group_api.js.map +1 -0
- package/hop.d.ts +62 -76
- package/hop.d.ts.map +1 -1
- package/hop.js +92 -64
- package/hop.js.map +1 -1
- package/identity.d.ts +39 -0
- package/identity.d.ts.map +1 -0
- package/identity.js +47 -0
- package/identity.js.map +1 -0
- package/ietf/active_count.d.ts +2 -0
- package/ietf/active_count.d.ts.map +1 -0
- package/ietf/active_count.js +30 -0
- package/ietf/active_count.js.map +1 -0
- package/ietf/aliases.js +69 -35
- package/ietf/aliases.js.map +1 -1
- package/ietf/cluster.d.ts +3 -3
- package/ietf/cluster.js +14 -62
- package/ietf/cluster.js.map +1 -1
- package/ietf/connection.d.ts +1 -31
- package/ietf/connection.d.ts.map +1 -1
- package/ietf/connection.js +305 -143
- package/ietf/connection.js.map +1 -1
- package/ietf/datagram.d.ts +60 -0
- package/ietf/datagram.d.ts.map +1 -0
- package/ietf/datagram.js +152 -0
- package/ietf/datagram.js.map +1 -0
- package/ietf/error.d.ts +3 -3
- package/ietf/error.js +82 -100
- package/ietf/error.js.map +1 -1
- package/ietf/fetch.d.ts +91 -35
- package/ietf/fetch.d.ts.map +1 -1
- package/ietf/fetch.js +172 -93
- package/ietf/fetch.js.map +1 -1
- package/ietf/filter.d.ts +20 -30
- package/ietf/filter.d.ts.map +1 -1
- package/ietf/filter.js +140 -171
- package/ietf/filter.js.map +1 -1
- package/ietf/goaway.d.ts +11 -9
- package/ietf/goaway.d.ts.map +1 -1
- package/ietf/goaway.js +22 -35
- package/ietf/goaway.js.map +1 -1
- package/ietf/hidden.js +1 -1
- package/ietf/hidden.js.map +1 -1
- package/ietf/index.d.ts +2 -14
- package/ietf/index.d.ts.map +1 -1
- package/ietf/index.js +4 -14
- package/ietf/index.js.map +1 -1
- package/ietf/join.d.ts +7 -0
- package/ietf/join.d.ts.map +1 -0
- package/ietf/join.js +234 -0
- package/ietf/join.js.map +1 -0
- package/ietf/message.d.ts +18 -2
- package/ietf/message.d.ts.map +1 -1
- package/ietf/message.js +60 -40
- package/ietf/message.js.map +1 -1
- package/ietf/message.test-util.d.ts +6 -0
- package/ietf/message.test-util.d.ts.map +1 -0
- package/ietf/message.test-util.js +13 -0
- package/ietf/message.test-util.js.map +1 -0
- package/ietf/namespace.d.ts +17 -3
- package/ietf/namespace.d.ts.map +1 -1
- package/ietf/namespace.js +78 -26
- package/ietf/namespace.js.map +1 -1
- package/ietf/object.d.ts +194 -32
- package/ietf/object.d.ts.map +1 -1
- package/ietf/object.js +405 -178
- package/ietf/object.js.map +1 -1
- package/ietf/parameters.d.ts +22 -42
- package/ietf/parameters.d.ts.map +1 -1
- package/ietf/parameters.js +260 -472
- package/ietf/parameters.js.map +1 -1
- package/ietf/priority.d.ts +17 -2
- package/ietf/priority.d.ts.map +1 -1
- package/ietf/priority.js +19 -4
- package/ietf/priority.js.map +1 -1
- package/ietf/properties.d.ts +5 -4
- package/ietf/properties.d.ts.map +1 -1
- package/ietf/properties.js +78 -48
- package/ietf/properties.js.map +1 -1
- package/ietf/publish.d.ts +22 -30
- package/ietf/publish.d.ts.map +1 -1
- package/ietf/publish.js +45 -139
- package/ietf/publish.js.map +1 -1
- package/ietf/publish_namespace.d.ts +46 -69
- package/ietf/publish_namespace.d.ts.map +1 -1
- package/ietf/publish_namespace.js +66 -184
- package/ietf/publish_namespace.js.map +1 -1
- package/ietf/publisher.js +1800 -600
- package/ietf/publisher.js.map +1 -1
- package/ietf/range.d.ts +2 -0
- package/ietf/range.d.ts.map +1 -0
- package/ietf/range.js +222 -0
- package/ietf/range.js.map +1 -0
- package/ietf/request.d.ts +3 -27
- package/ietf/request.d.ts.map +1 -1
- package/ietf/request.js +41 -78
- package/ietf/request.js.map +1 -1
- package/ietf/request_stream.d.ts +1 -6
- package/ietf/request_stream.d.ts.map +1 -1
- package/ietf/request_stream.js +306 -16
- package/ietf/request_stream.js.map +1 -1
- package/ietf/session.d.ts +41 -0
- package/ietf/session.d.ts.map +1 -0
- package/ietf/session.js +65 -0
- package/ietf/session.js.map +1 -0
- package/ietf/setup.d.ts +4 -29
- package/ietf/setup.d.ts.map +1 -1
- package/ietf/setup.js +6 -117
- package/ietf/setup.js.map +1 -1
- package/ietf/setup_options.d.ts +31 -0
- package/ietf/setup_options.d.ts.map +1 -0
- package/ietf/setup_options.js +138 -0
- package/ietf/setup_options.js.map +1 -0
- package/ietf/solicit.js +4 -14
- package/ietf/solicit.js.map +1 -1
- package/ietf/subscribe.d.ts +48 -41
- package/ietf/subscribe.d.ts.map +1 -1
- package/ietf/subscribe.js +118 -239
- package/ietf/subscribe.js.map +1 -1
- package/ietf/subscribe_namespace.d.ts +13 -76
- package/ietf/subscribe_namespace.d.ts.map +1 -1
- package/ietf/subscribe_namespace.js +30 -201
- package/ietf/subscribe_namespace.js.map +1 -1
- package/ietf/subscriber.js +1839 -536
- package/ietf/subscriber.js.map +1 -1
- package/ietf/token.js +105 -27
- package/ietf/token.js.map +1 -1
- package/ietf/track.d.ts +25 -22
- package/ietf/track.d.ts.map +1 -1
- package/ietf/track.js +48 -61
- package/ietf/track.js.map +1 -1
- package/ietf/version.d.ts +13 -42
- package/ietf/version.d.ts.map +1 -1
- package/ietf/version.js +22 -48
- package/ietf/version.js.map +1 -1
- package/implementation.d.ts +2 -0
- package/implementation.d.ts.map +1 -0
- package/implementation.js +5 -0
- package/implementation.js.map +1 -0
- package/index.d.ts +25 -10
- package/index.d.ts.map +1 -1
- package/index.js +19 -6
- package/index.js.map +1 -1
- package/internal.d.ts +1512 -64
- package/internal.d.ts.map +1 -1
- package/internal.js +557 -79
- package/internal.js.map +1 -1
- package/ledger.d.ts +23 -0
- package/ledger.d.ts.map +1 -0
- package/ledger.js +247 -0
- package/ledger.js.map +1 -0
- package/listing.d.ts +132 -0
- package/listing.d.ts.map +1 -0
- package/listing.js +486 -0
- package/listing.js.map +1 -0
- package/lite/announce.d.ts +124 -63
- package/lite/announce.d.ts.map +1 -1
- package/lite/announce.js +384 -158
- package/lite/announce.js.map +1 -1
- package/lite/announce_stream.d.ts +2 -0
- package/lite/announce_stream.d.ts.map +1 -0
- package/lite/announce_stream.js +92 -0
- package/lite/announce_stream.js.map +1 -0
- package/lite/answer.d.ts +22 -0
- package/lite/answer.d.ts.map +1 -0
- package/lite/answer.js +301 -0
- package/lite/answer.js.map +1 -0
- package/lite/auth.d.ts +45 -0
- package/lite/auth.d.ts.map +1 -0
- package/lite/auth.js +204 -0
- package/lite/auth.js.map +1 -0
- package/lite/compat.d.ts +31 -0
- package/lite/compat.d.ts.map +1 -0
- package/lite/compat.js +86 -0
- package/lite/compat.js.map +1 -0
- package/lite/connection.d.ts +1 -45
- package/lite/connection.d.ts.map +1 -1
- package/lite/connection.js +360 -77
- package/lite/connection.js.map +1 -1
- package/lite/datagram-end.d.ts +26 -0
- package/lite/datagram-end.d.ts.map +1 -0
- package/lite/datagram-end.js +30 -0
- package/lite/datagram-end.js.map +1 -0
- package/lite/datagram.d.ts +73 -8
- package/lite/datagram.d.ts.map +1 -1
- package/lite/datagram.js +144 -9
- package/lite/datagram.js.map +1 -1
- package/lite/duration.d.ts +6 -0
- package/lite/duration.d.ts.map +1 -0
- package/lite/duration.js +14 -0
- package/lite/duration.js.map +1 -0
- package/lite/error.d.ts +9 -0
- package/lite/error.d.ts.map +1 -0
- package/lite/error.js +24 -0
- package/lite/error.js.map +1 -0
- package/lite/fills.d.ts +162 -0
- package/lite/fills.d.ts.map +1 -0
- package/lite/fills.js +486 -0
- package/lite/fills.js.map +1 -0
- package/lite/fit.d.ts +49 -0
- package/lite/fit.d.ts.map +1 -0
- package/lite/fit.js +305 -0
- package/lite/fit.js.map +1 -0
- package/lite/goaway.d.ts +1 -1
- package/lite/goaway.d.ts.map +1 -1
- package/lite/goaway.js +5 -13
- package/lite/goaway.js.map +1 -1
- package/lite/group.d.ts +64 -13
- package/lite/group.d.ts.map +1 -1
- package/lite/group.js +108 -30
- package/lite/group.js.map +1 -1
- package/lite/identity.d.ts +25 -0
- package/lite/identity.d.ts.map +1 -0
- package/lite/identity.js +79 -0
- package/lite/identity.js.map +1 -0
- package/lite/index.d.ts +2 -1
- package/lite/index.d.ts.map +1 -1
- package/lite/index.js +2 -1
- package/lite/index.js.map +1 -1
- package/lite/message.d.ts +9 -1
- package/lite/message.d.ts.map +1 -1
- package/lite/message.js +28 -44
- package/lite/message.js.map +1 -1
- package/lite/priority.d.ts +9 -2
- package/lite/priority.d.ts.map +1 -1
- package/lite/priority.js +11 -105
- package/lite/priority.js.map +1 -1
- package/lite/probe.d.ts.map +1 -1
- package/lite/probe.js +9 -0
- package/lite/probe.js.map +1 -1
- package/lite/publisher.d.ts +10 -1
- package/lite/publisher.d.ts.map +1 -1
- package/lite/publisher.js +2548 -437
- package/lite/publisher.js.map +1 -1
- package/lite/routed.d.ts +59 -0
- package/lite/routed.d.ts.map +1 -0
- package/lite/routed.js +564 -0
- package/lite/routed.js.map +1 -0
- package/lite/session.d.ts +1 -27
- package/lite/session.d.ts.map +1 -1
- package/lite/session.js +0 -99
- package/lite/session.js.map +1 -1
- package/lite/setup.d.ts +29 -2
- package/lite/setup.d.ts.map +1 -1
- package/lite/setup.js +95 -21
- package/lite/setup.js.map +1 -1
- package/lite/stream.d.ts +5 -11
- package/lite/stream.d.ts.map +1 -1
- package/lite/stream.js +5 -1
- package/lite/stream.js.map +1 -1
- package/lite/subscribe.d.ts +475 -75
- package/lite/subscribe.d.ts.map +1 -1
- package/lite/subscribe.js +1373 -142
- package/lite/subscribe.js.map +1 -1
- package/lite/subscriber.d.ts +7 -44
- package/lite/subscriber.d.ts.map +1 -1
- package/lite/subscriber.js +3290 -515
- package/lite/subscriber.js.map +1 -1
- package/lite/track.d.ts +24 -9
- package/lite/track.d.ts.map +1 -1
- package/lite/track.js +116 -37
- package/lite/track.js.map +1 -1
- package/lite/tracks.d.ts +55 -0
- package/lite/tracks.d.ts.map +1 -0
- package/lite/tracks.js +114 -0
- package/lite/tracks.js.map +1 -0
- package/lite/version.d.ts +132 -24
- package/lite/version.d.ts.map +1 -1
- package/lite/version.js +378 -33
- package/lite/version.js.map +1 -1
- package/meta.d.ts +77 -0
- package/meta.d.ts.map +1 -0
- package/meta.js +130 -0
- package/meta.js.map +1 -0
- package/meta_api.d.ts +7 -0
- package/meta_api.d.ts.map +1 -0
- package/meta_api.js +7 -0
- package/meta_api.js.map +1 -0
- package/mint.d.ts +28 -0
- package/mint.d.ts.map +1 -0
- package/mint.js +66 -0
- package/mint.js.map +1 -0
- package/open.d.ts +63 -0
- package/open.d.ts.map +1 -0
- package/open.js +250 -0
- package/open.js.map +1 -0
- package/origin.d.ts +392 -140
- package/origin.d.ts.map +1 -1
- package/origin.js +2533 -686
- package/origin.js.map +1 -1
- package/package.json +8 -13
- package/path.d.ts +51 -51
- package/path.d.ts.map +1 -1
- package/path.js +210 -57
- package/path.js.map +1 -1
- package/payload.d.ts +33 -0
- package/payload.d.ts.map +1 -0
- package/payload.js +65 -0
- package/payload.js.map +1 -0
- package/prefix.d.ts +152 -0
- package/prefix.d.ts.map +1 -0
- package/prefix.js +349 -0
- package/prefix.js.map +1 -0
- package/priority.d.ts +8 -0
- package/priority.d.ts.map +1 -0
- package/priority.js +185 -0
- package/priority.js.map +1 -0
- package/queue.d.ts +2 -0
- package/queue.d.ts.map +1 -0
- package/queue.js +46 -0
- package/queue.js.map +1 -0
- package/ranges.d.ts +36 -0
- package/ranges.d.ts.map +1 -0
- package/ranges.js +312 -0
- package/ranges.js.map +1 -0
- package/rescale.d.ts +24 -0
- package/rescale.d.ts.map +1 -0
- package/rescale.js +39 -0
- package/rescale.js.map +1 -0
- package/resume.d.ts +55 -0
- package/resume.d.ts.map +1 -0
- package/resume.js +4173 -0
- package/resume.js.map +1 -0
- package/resume.test-util.d.ts +2 -0
- package/resume.test-util.d.ts.map +1 -0
- package/resume.test-util.js +25 -0
- package/resume.test-util.js.map +1 -0
- package/skips.d.ts +48 -0
- package/skips.d.ts.map +1 -0
- package/skips.js +182 -0
- package/skips.js.map +1 -0
- package/stream.d.ts +75 -37
- package/stream.d.ts.map +1 -1
- package/stream.js +236 -92
- package/stream.js.map +1 -1
- package/subscription.test-util.d.ts +2 -0
- package/subscription.test-util.d.ts.map +1 -0
- package/subscription.test-util.js +49 -0
- package/subscription.test-util.js.map +1 -0
- package/tail.d.ts +23 -14
- package/tail.d.ts.map +1 -1
- package/tail.js +224 -97
- package/tail.js.map +1 -1
- package/time.d.ts +41 -102
- package/time.d.ts.map +1 -1
- package/time.js +129 -91
- package/time.js.map +1 -1
- package/timed.d.ts +21 -0
- package/timed.d.ts.map +1 -0
- package/timed.js +2 -0
- package/timed.js.map +1 -0
- package/track.d.ts +577 -245
- package/track.d.ts.map +1 -1
- package/track.js +7306 -771
- package/track.js.map +1 -1
- package/track_api.d.ts +7 -0
- package/track_api.d.ts.map +1 -0
- package/track_api.js +7 -0
- package/track_api.js.map +1 -0
- package/util/abort.d.ts +1 -0
- package/util/abort.d.ts.map +1 -1
- package/util/abort.js +23 -1
- package/util/abort.js.map +1 -1
- package/util/announce.d.ts +4 -0
- package/util/announce.d.ts.map +1 -0
- package/util/announce.js +11 -0
- package/util/announce.js.map +1 -0
- package/util/bigint.d.ts +3 -0
- package/util/bigint.d.ts.map +1 -0
- package/util/bigint.js +8 -0
- package/util/bigint.js.map +1 -0
- package/util/change.d.ts +12 -0
- package/util/change.d.ts.map +1 -0
- package/util/change.js +18 -0
- package/util/change.js.map +1 -0
- package/util/deadline.d.ts +2 -0
- package/util/deadline.d.ts.map +1 -0
- package/util/deadline.js +108 -0
- package/util/deadline.js.map +1 -0
- package/util/decode_error.d.ts +3 -0
- package/util/decode_error.d.ts.map +1 -0
- package/util/decode_error.js +11 -0
- package/util/decode_error.js.map +1 -0
- package/util/demand.d.ts +8 -0
- package/util/demand.d.ts.map +1 -0
- package/util/demand.js +24 -0
- package/util/demand.js.map +1 -0
- package/util/given_up.d.ts +2 -0
- package/util/given_up.d.ts.map +1 -0
- package/util/given_up.js +101 -0
- package/util/given_up.js.map +1 -0
- package/util/hex.d.ts +6 -0
- package/util/hex.d.ts.map +1 -1
- package/util/hex.js +19 -4
- package/util/hex.js.map +1 -1
- package/util/key.d.ts +15 -0
- package/util/key.d.ts.map +1 -0
- package/util/key.js +38 -0
- package/util/key.js.map +1 -0
- package/util/limits.d.ts +2 -0
- package/util/limits.d.ts.map +1 -0
- package/util/limits.js +76 -0
- package/util/limits.js.map +1 -0
- package/util/observed.d.ts +23 -0
- package/util/observed.d.ts.map +1 -0
- package/util/observed.js +122 -0
- package/util/observed.js.map +1 -0
- package/util/sorted.d.ts +2 -0
- package/util/sorted.d.ts.map +1 -0
- package/util/sorted.js +149 -0
- package/util/sorted.js.map +1 -0
- package/util/timeout.d.ts +2 -1
- package/util/timeout.d.ts.map +1 -1
- package/util/timeout.js +13 -9
- package/util/timeout.js.map +1 -1
- package/util/timer.d.ts +2 -0
- package/util/timer.d.ts.map +1 -0
- package/util/timer.js +19 -0
- package/util/timer.js.map +1 -0
- package/util/utf8.d.ts +2 -0
- package/util/utf8.d.ts.map +1 -1
- package/util/utf8.js +7 -1
- package/util/utf8.js.map +1 -1
- package/util/varint.d.ts.map +1 -1
- package/util/varint.js +8 -1
- package/util/varint.js.map +1 -1
- package/util/watch.d.ts +8 -0
- package/util/watch.d.ts.map +1 -0
- package/util/watch.js +38 -0
- package/util/watch.js.map +1 -0
- package/util/yield.d.ts +2 -0
- package/util/yield.d.ts.map +1 -0
- package/util/yield.js +31 -0
- package/util/yield.js.map +1 -0
- package/varint.d.ts +0 -29
- package/varint.d.ts.map +1 -1
- package/varint.js +7 -28
- package/varint.js.map +1 -1
- package/varint_api.d.ts +7 -0
- package/varint_api.d.ts.map +1 -0
- package/varint_api.js +7 -0
- package/varint_api.js.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +4 -0
- package/version.js.map +1 -0
- package/window.d.ts +570 -0
- package/window.d.ts.map +1 -0
- package/window.js +1677 -0
- package/window.js.map +1 -0
- package/wire.d.ts +145 -30
- package/wire.d.ts.map +1 -1
- package/wire.js +27 -0
- package/wire.js.map +1 -1
- package/connection/established.d.ts +0 -53
- package/connection/established.d.ts.map +0 -1
- package/connection/established.js +0 -2
- package/connection/established.js.map +0 -1
- package/ietf/adapter.d.ts +0 -75
- package/ietf/adapter.d.ts.map +0 -1
- package/ietf/adapter.js +0 -699
- package/ietf/adapter.js.map +0 -1
- package/lite/datagram_stream.d.ts +0 -8
- package/lite/datagram_stream.d.ts.map +0 -1
- package/lite/datagram_stream.js +0 -43
- package/lite/datagram_stream.js.map +0 -1
- package/lite/fetch.d.ts +0 -28
- package/lite/fetch.d.ts.map +0 -1
- package/lite/fetch.js +0 -78
- package/lite/fetch.js.map +0 -1
- package/util/log.d.ts +0 -5
- package/util/log.d.ts.map +0 -1
- package/util/log.js +0 -16
- package/util/log.js.map +0 -1
- package/zod.d.ts +0 -13
- package/zod.d.ts.map +0 -1
- package/zod.js +0 -18
- package/zod.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forward.js","sourceRoot":"","sources":["../../src/connection/forward.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAgB,IAAI,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM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AC;AAClB,CAAC","sourcesContent":["/**\n * Feeds a session's announced routes into an origin; the `consume` connect option.\n *\n * @module\n */\nimport { type Dispose, race } from \"@moq/signals\";\nimport { isActive } from \"../announced.ts\";\nimport type { Dynamic, Producer as OriginProducer, RequestSlot } from \"../origin.ts\";\nimport * as Path from \"../path.ts\";\nimport { wireOf } from \"../wire.ts\";\nimport type { Established } from \"./established.ts\";\n\n/**\n * Wire a session into `origin` for the session's lifetime: forward the peer's announced\n * routes into the table, and answer the origin's open requests with blind\n * subscriptions.\n *\n * Each active announcement inserts a route covering the announced prefix, served\n * lazily through this connection, so nothing touches the wire until somebody requests\n * a path under it. A retraction removes the entry, and so does the session dying (the\n * announce stream ends with it), which is what scopes remote routes to the session\n * that announced them. A reconnect wires a fresh session to the same origin and\n * re-populates it.\n *\n * Without discovery there are no announcements to forward, so the table stays empty and\n * requests are the only way through; see the origin's `request`.\n *\n * @internal\n */\nexport function forwardAnnounced(conn: Established, origin: OriginProducer): void {\n\tconst originWire = wireOf(origin);\n\t// Reassigned if discovery dies under a live session, so the origin stops counting this\n\t// one as a discovering session. Called through a closure so the session's death always\n\t// detaches whichever attachment is current.\n\tlet detach = originWire.attach(conn.discovery);\n\n\tlet dead = false;\n\tlet discovering = conn.discovery;\n\tvoid conn.closed.then(() => {\n\t\tdead = true;\n\t\tdetach();\n\t});\n\n\tvoid serveRequests(conn, origin);\n\n\tif (!conn.discovery) {\n\t\tconsole.warn(\"relay does not support broadcast discovery; broadcasts resolve on request only.\");\n\t\treturn;\n\t}\n\n\tfor (const prefix of originWire.interests()) {\n\t\t// Hidden routes are mirrored too; each local reader opts in on its own.\n\t\tconst announced = conn.announced(Path.Pattern.subtree(prefix), { hidden: true });\n\t\tconst inserted = new Map<Path.Valid, Dynamic>();\n\n\t\t// End the stream the moment the session closes rather than waiting for the wire to\n\t\t// error it, so the retractions below land promptly.\n\t\tvoid conn.closed.then(() => announced.close());\n\n\t\tvoid (async () => {\n\t\t\tlet failure: unknown;\n\t\t\ttry {\n\t\t\t\tfor (;;) {\n\t\t\t\t\tconst event = await announced.next();\n\t\t\t\t\tif (!event) break;\n\t\t\t\t\tif (!originWire.accepts(event.prefix)) continue;\n\n\t\t\t\t\tif (isActive(event.kind)) {\n\t\t\t\t\t\tconst existing = inserted.get(event.prefix);\n\t\t\t\t\t\tif (existing) {\n\t\t\t\t\t\t\texisting.update(event.route);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst handle = originWire.receive(event.prefix, event.route);\n\t\t\t\t\t\t\tinserted.set(event.prefix, handle);\n\t\t\t\t\t\t\tvoid drive(handle, conn);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst handle = inserted.get(event.prefix);\n\t\t\t\t\t\tinserted.delete(event.prefix);\n\t\t\t\t\t\thandle?.close();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// The session died mid-stream, or the relay refused or reset the stream. The\n\t\t\t\t// cleanup below retracts everything this stream fed either way.\n\t\t\t\tfailure = err;\n\t\t\t} finally {\n\t\t\t\tfor (const handle of inserted.values()) handle.close();\n\t\t\t\tinserted.clear();\n\t\t\t\tannounced.close();\n\n\t\t\t\t// Discovery ended while the session lives, and nothing reopens the stream on this\n\t\t\t\t// connection. Downgrade the attachment rather than leaving the origin claiming a\n\t\t\t\t// discovery that no longer works: announcement-gated consumers would wait forever\n\t\t\t\t// on a table this session can no longer fill. Now they fall back to standing\n\t\t\t\t// requests, which this session still answers.\n\t\t\t\tif (!dead && discovering) {\n\t\t\t\t\tdiscovering = false;\n\t\t\t\t\tconsole.warn(\"broadcast discovery failed; broadcasts resolve on request only.\", failure);\n\t\t\t\t\tdetach();\n\t\t\t\t\tdetach = originWire.attach(false);\n\t\t\t\t}\n\t\t\t}\n\t\t})();\n\t}\n}\n\n/**\n * Answer the origin's open requests with blind subscriptions for the session's lifetime.\n *\n * Every session answers, discovery or not: subscribing to an unannounced path is always\n * legal, and a missing broadcast surfaces as a reset on the first track. The first session\n * to answer wins; when this session dies its answers are withdrawn so a later session\n * answers again, which is what makes a request span reconnects.\n *\n * A path the table already routes is left alone. A request resolves to the table's route over\n * any blind answer, so answering one would only park a handle nothing reads.\n */\nasync function drive(handle: Dynamic, conn: Established): Promise<void> {\n\tconst session = wireOf(conn);\n\ttry {\n\t\tfor await (const request of handle.requested()) {\n\t\t\trequest.accept(session.consume(request.path));\n\t\t}\n\t} catch {\n\t\thandle.close();\n\t}\n}\n\nasync function serveRequests(conn: Established, origin: OriginProducer): Promise<void> {\n\tconst table = wireOf(origin);\n\tconst session = wireOf(conn);\n\t// The withdraws for the answers this session provided, so a dead session only takes\n\t// back its own. Keyed by path but remembering the slot, because a path outlives its\n\t// slot: the last handle closing tears the slot down and a new request installs a fresh\n\t// one, and those two writes coalesce into a single wakeup. Matching on the path alone\n\t// would read the new slot as already answered and leave it unanswered forever.\n\tconst answered = new Map<Path.Valid, { slot: RequestSlot; withdraw: Dispose }>();\n\n\tlet dead = false;\n\tconst closed = conn.closed.then(() => {\n\t\tdead = true;\n\t});\n\n\tfor (;;) {\n\t\tconst map = table.requests.peek();\n\t\tif (!map || dead) break;\n\n\t\tfor (const [path, slot] of map) {\n\t\t\tif (slot.blind === 0) continue;\n\t\t\tif (answered.get(path)?.slot === slot || slot.answer !== undefined) continue;\n\t\t\tif (table.routes(path)) continue;\n\t\t\tconst withdraw = table.answer(path, session.consume(path));\n\t\t\tif (withdraw) answered.set(path, { slot, withdraw });\n\t\t}\n\n\t\t// A withdrawn request already released the answer; just forget our claim on the path.\n\t\t// A replaced slot counts as withdrawn: the answer we hold belongs to the slot that\n\t\t// went away, not to whatever now occupies the path.\n\t\tfor (const [path, entry] of [...answered]) {\n\t\t\tif (map.get(path) === entry.slot && entry.slot.blind > 0) continue;\n\t\t\tanswered.delete(path);\n\t\t\tentry.withdraw();\n\t\t}\n\n\t\t// Woken by the table too, not just the requests: a path that stops being routed needs\n\t\t// the blind answer this loop skipped while it was.\n\t\tawait race([table.changed(), closed]);\n\t}\n\n\t// Session gone: withdraw our answers, waking a standby session to provide fresh ones.\n\tfor (const { withdraw } of answered.values()) {\n\t\twithdraw();\n\t}\n\tanswered.clear();\n}\n"]}
|
|
1
|
+
{"version":3,"file":"forward.js","sourceRoot":"","sources":["../../src/connection/forward.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAgB,IAAI,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAoB,MAAM,EAAE,MAAM,YAAY,CAAC;AAGtD,uFAAuF;AACvF,MAAM,CAAC,MAAM,iBAAiB,GAC7B,kHAAkH,CAAC;AAEpH,4GAA4G;AAC5G,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAQrC,SAAS,KAAK,CAAC,MAAkB,EAAE,KAAgB;IAClD,OAAO,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,SAAS,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;AACpG,CAAC;AAyBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAa,EAAE,MAAsB;IACrE,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7B,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IACpC,uFAAuF;IACvF,mFAAmF;I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,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACvC,CAAC;IAED,sFAAsF;IACtF,KAAK,MAAM,EAAE,QAAQ,EAAE,IAAI,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;QAC9C,QAAQ,EAAE,CAAC;IACZ,CAAC;IACD,QAAQ,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC","sourcesContent":["/**\n * Feeds a session's announced routes into an origin; the `consume` connect option.\n *\n * @module\n */\n\nimport { Duration } from \"@moq/clock\";\nimport { type Dispose, race } from \"@moq/signals\";\nimport type * as Announce from \"../announced.ts\";\nimport { routesEqual, type WireRoute } from \"../hop.ts\";\nimport { coveringPrefixes } from \"../internal.ts\";\nimport type { Claim, Producer as OriginProducer } from \"../origin.ts\";\nimport * as Path from \"../path.ts\";\nimport { after } from \"../util/timer.ts\";\nimport { type RequestSlot, wireOf } from \"../wire.ts\";\nimport type { Session } from \"./session.ts\";\n\n/** Why a connection refuses the removed `discovery` option rather than ignoring it. */\nexport const DISCOVERY_REMOVED =\n\t\"the discovery option is removed: a session asks only about watched prefixes and turns blind if the relay refuses\";\n\n/** How long an announce request outlives its last watcher, so a watcher torn down and rebuilt reuses it. */\nconst LINGER = Duration.millis(2000);\n\n/**\n * Names one route a session reports: its prefix, and on lite-07 the identity whose claim it is,\n * since a stream reports each identity's claim at a path as its own route.\n */\ntype Key = string;\n\nfunction keyOf(prefix: Path.Valid, route: WireRoute): Key {\n\treturn route.claimed && route.identity !== undefined ? `${prefix}\\u0000${route.identity}` : prefix;\n}\n\n/** One announce request open on the session, and the routes it currently reports. */\ninterface Interest {\n\treadonly announced: Announce.Routes;\n\treadonly reported: Set<Key>;\n\t/** The pending close, set while nothing at or beneath the prefix is watched. */\n\tlinger?: () => void;\n\t/** Closed on purpose, so its end is not a discovery failure. */\n\tclosing: boolean;\n\t/** Narrower requests nothing watches any more, kept open until this one goes. */\n\treadonly held: Map<Path.Valid, Interest>;\n}\n\n/**\n * A route one or more overlapping requests report, inserted into the origin once so a\n * request handing over to another never retracts it. The first reporter drives it.\n */\ninterface Reported {\n\treadonly prefix: Path.Valid;\n\thandle: Claim;\n\t/** Each request's latest route for the prefix. */\n\treadonly reporters: Map<Interest, WireRoute>;\n}\n\n/**\n * Wire a session into `origin` for the session's lifetime: forward the peer's announced\n * routes under the prefixes the origin's readers watch, and answer the origin's open\n * requests with blind subscriptions.\n *\n * Discovery is lazy. One announce request opens per prefix in the origin's covering set of\n * watches (`announced(scope)` and every `request(path)`) that no open request\n * already covers, and closes {@link LINGER} after nothing at or beneath its prefix is watched.\n * A narrower watch rides an open broader request, and a narrower request already open stays\n * open until the broader one covering it goes, so neither takes the other's routes over\n * before it has synced, which not every version can tell. A route both report is inserted once and\n * driven by its first reporter; if it changes hands anyway (a request failing), it restarts\n * unless one identity proves both requests saw one stream.\n *\n * A peer that refuses overlapping requests gets exclusive discovery instead: a broader request\n * closes the narrower ones beneath it, and the session keeps it off the wire until they have\n * left. The routes a closed request carried go with it, and come back once the broader request\n * reports them.\n *\n * A lite-07 claim serves only the paths the session's floors still certify beneath it, asked\n * per request, and asked again for every open request when a floor moves that with no route\n * changing.\n *\n * Each active announcement inserts a route covering the announced prefix, served lazily\n * through this connection, so nothing touches the wire until somebody requests a path\n * under it. A retraction removes the entry, and so does the session dying, which is what\n * scopes remote routes to the session that announced them. A reconnect wires a fresh\n * session to the same origin and re-opens whatever is still watched.\n *\n * A peer that refuses or resets an announce request downgrades the whole session to blind\n * answers: plain requests subscribe through it without waiting for an announcement, and\n * later watches open nothing on it.\n *\n * @internal\n */\nexport function forwardAnnounced(conn: Session, origin: OriginProducer): void {\n\tconst originWire = wireOf(origin);\n\tconst session = wireOf(conn);\n\tconst exclusive = session.exclusive;\n\t// Reassigned on a downgrade, so the origin stops counting this session as discovering.\n\t// Called through a closure so the session's death always detaches the current one.\n\tlet detach = originWire.attach(true);\n\tlet dead = false;\n\tlet blind = false;\n\n\tconst interests = new Map<Path.Valid, Interest>();\n\tconst routes = new Map<Key, Reported>();\n\n\tvoid serveRequests(conn, origin);\n\n\tconst report = (interest: Interest, event: Announce.RouteEvent) => {\n\t\tconst { prefix, route } = event;\n\t\tconst key = keyOf(prefix, route);\n\t\tif (event.kind === \"end\" || event.kind === \"offline\") {\n\t\t\tunreport(interest, key, event.kind === \"end\");\n\t\t\treturn;\n\t\t}\n\t\tinterest.reported.add(key);\n\n\t\tconst existing = routes.get(key);\n\t\tif (!existing) {\n\t\t\tconst handle = originWire.receive(prefix, route);\n\t\t\troutes.set(key, { prefix, handle, reporters: new Map([[interest, route]]) });\n\t\t\tvoid drive(handle, conn);\n\t\t\treturn;\n\t\t}\n\n\t\tconst joined = existing.reporters.has(interest);\n\t\texisting.reporters.set(interest, route);\n\t\t// Another request covering the prefix only holds it; the first reporter drives it.\n\t\tif (joined && existing.reporters.keys().next().value === interest) {\n\t\t\tupdateReported(existing, route, event.kind === \"restart\");\n\t\t}\n\t};\n\n\t/**\n\t * Bring the handle up to its driving reporter's route: a fresh route for another publisher\n\t * identity or epoch, so nothing resolved through the old one is joined again, and an in-place\n\t * update otherwise.\n\t */\n\tconst updateReported = (existing: Reported, route: WireRoute, restart: boolean) => {\n\t\tconst current = wireOf(existing.handle).info;\n\t\tif (restart || route.identity !== current?.identity || route.epoch !== current?.epoch) {\n\t\t\t// Inserted before the old one leaves, so local readers see one restart rather than\n\t\t\t// an end and a start.\n\t\t\tconst handle = originWire.receive(existing.prefix, route);\n\t\t\texisting.handle.close();\n\t\t\texisting.handle = handle;\n\t\t\tvoid drive(handle, conn);\n\t\t} else if (!routesEqual(current, route)) {\n\t\t\twireOf(existing.handle).update(route);\n\t\t}\n\t};\n\n\t/** Stop `interest` reporting the route `key` names, which its peer `ended` rather than lost. */\n\tconst unreport = (interest: Interest, key: Key, ended = false) => {\n\t\tinterest.reported.delete(key);\n\t\tconst existing = routes.get(key);\n\t\tif (!existing) return;\n\t\tconst driving = existing.reporters.keys().next().value === interest;\n\t\tif (!existing.reporters.delete(interest)) return;\n\n\t\tconst next = existing.reporters.values().next();\n\t\tif (next.done) {\n\t\t\troutes.delete(key);\n\t\t\tif (ended) wireOf(existing.handle).end();\n\t\t\telse existing.handle.close();\n\t\t} else if (driving) {\n\t\t\t// The next request takes over driving. Without an identity nothing proves it reports\n\t\t\t// the stream the handle serves, so the route restarts rather than stitch two together.\n\t\t\tupdateReported(existing, next.value, next.value.identity === undefined);\n\t\t}\n\t};\n\n\tconst downgrade = (failure: unknown) => {\n\t\tif (blind) return;\n\t\tblind = true;\n\t\t// Plain requests can still use this session's blind answers. Announcement followers\n\t\t// keep waiting for a source that can discover their path.\n\t\tconsole.warn(\"broadcast discovery failed; broadcasts resolve on request only.\", failure);\n\t\tdetach();\n\t\tdetach = originWire.attach(false);\n\t};\n\n\tconst open = (prefix: Path.Valid) => {\n\t\tif (exclusive) {\n\t\t\tfor (const [other, narrower] of interests) {\n\t\t\t\tif (other === prefix || !Path.hasPrefix(prefix, other)) continue;\n\t\t\t\tinterests.delete(other);\n\t\t\t\tnarrower.closing = true;\n\t\t\t\tnarrower.linger?.();\n\t\t\t\tnarrower.linger = undefined;\n\t\t\t\tnarrower.announced.close();\n\t\t\t}\n\t\t}\n\n\t\t// Hidden and covering routes are mirrored too; each local reader opts in on its own.\n\t\tconst interest: Interest = {\n\t\t\tannounced: conn.routes(prefix, { hidden: true, covering: true, claims: true }),\n\t\t\treported: new Set(),\n\t\t\tclosing: false,\n\t\t\theld: new Map(),\n\t\t};\n\t\tinterests.set(prefix, interest);\n\n\t\t// The origin's readers under the prefix wait on this request's initial set. Released\n\t\t// once the session stream has synced, which it reports only after the last of those\n\t\t// events is reported here. A closing stream also reads as synced, but a failure is not\n\t\t// an answer: the loop below releases it with the downgrade, in one step.\n\t\tconst snapshot = originWire.snapshot(prefix);\n\t\tconst synced = interest.announced.synced.subscribe((synced) => {\n\t\t\tif (synced && interest.announced.closed.peek() === undefined) snapshot();\n\t\t});\n\t\t// A request with no initial set to wait for is synced before the listener exists.\n\t\tif (interest.announced.synced.peek()) snapshot();\n\n\t\tvoid (async () => {\n\t\t\tlet failure: unknown;\n\t\t\ttry {\n\t\t\t\tfor (;;) {\n\t\t\t\t\tconst event = await interest.announced.next();\n\t\t\t\t\tif (!event) break;\n\t\t\t\t\tif (originWire.accepts(event.prefix)) report(interest, event);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// The session died mid-stream, or the peer refused or reset the request.\n\t\t\t\tfailure = err;\n\t\t\t} finally {\n\t\t\t\tsynced();\n\t\t\t\tsnapshot();\n\t\t\t\tfor (const reported of [...interest.reported]) unreport(interest, reported);\n\n\t\t\t\tinterest.announced.close();\n\t\t\t\tinterest.linger?.();\n\t\t\t\tif (interests.get(prefix) === interest) interests.delete(prefix);\n\t\t\t\tif (!dead && !interest.closing) downgrade(failure);\n\t\t\t\t// What this request held now settles on its own, unless it is watched again.\n\t\t\t\tfor (const [held, narrower] of interest.held) {\n\t\t\t\t\tif (!dead && interests.get(held) === narrower && !beneath.has(held)) release(held, narrower);\n\t\t\t\t}\n\t\t\t}\n\t\t})();\n\t};\n\n\t// How many reports want each prefix; overlapping watches can name one prefix twice.\n\tconst wanted = new Map<Path.Valid, number>();\n\t// How many wanted prefixes sit at or beneath each prefix, so a request knows in a walk up\n\t// its path whether anything beneath it is still watched.\n\tconst beneath = new Map<Path.Valid, number>();\n\n\t/**\n\t * Settle a request nothing beneath it watches any more. A broader open request that is\n\t * still needed holds it until that one goes, so the broader never takes its routes over\n\t * before it has synced; otherwise it lingers out.\n\t */\n\tconst release = (prefix: Path.Valid, interest: Interest) => {\n\t\tfor (const above of coveringPrefixes(prefix)) {\n\t\t\tif (above === prefix) continue;\n\t\t\tconst holder = interests.get(above);\n\t\t\tif (!holder || !beneath.has(above)) continue;\n\t\t\tholder.held.set(prefix, interest);\n\t\t\treturn;\n\t\t}\n\t\tinterest.linger?.();\n\t\tinterest.linger = after(LINGER, () => {\n\t\t\t// Forgotten now rather than once its stream winds down, so a watch arriving\n\t\t\t// meanwhile opens a fresh request instead of reviving this one.\n\t\t\tinterests.delete(prefix);\n\t\t\tinterest.closing = true;\n\t\t\tinterest.announced.close();\n\t\t});\n\t};\n\n\tconst unsubscribe = originWire.interests((prefix, want) => {\n\t\tif (dead) return;\n\t\tconst count = (wanted.get(prefix) ?? 0) + (want ? 1 : -1);\n\t\tif (count > 0) wanted.set(prefix, count);\n\t\telse wanted.delete(prefix);\n\t\tif (count !== (want ? 1 : 0)) return;\n\n\t\tfor (const above of coveringPrefixes(prefix)) {\n\t\t\tconst held = (beneath.get(above) ?? 0) + (want ? 1 : -1);\n\t\t\tif (held > 0) beneath.set(above, held);\n\t\t\telse beneath.delete(above);\n\t\t}\n\n\t\t// A request stays open while anything beneath it is watched, so a narrower watch rides\n\t\t// it rather than opening a request that would later have to take its routes over.\n\t\tlet covered = false;\n\t\tfor (const above of coveringPrefixes(prefix)) {\n\t\t\tconst interest = interests.get(above);\n\t\t\tif (!interest) continue;\n\t\t\tcovered = true;\n\t\t\tif (beneath.has(above)) {\n\t\t\t\tinterest.linger?.();\n\t\t\t\tinterest.linger = undefined;\n\t\t\t} else {\n\t\t\t\trelease(above, interest);\n\t\t\t}\n\t\t}\n\t\tif (want && !covered && !blind) open(prefix);\n\t});\n\n\tvoid conn.closed.then(() => {\n\t\tdead = true;\n\t\tunsubscribe();\n\t\t// End every request the moment the session closes rather than waiting for the wire to\n\t\t// error it, so the retractions land promptly.\n\t\tfor (const interest of interests.values()) interest.announced.close();\n\t\tdetach();\n\t});\n}\n\n/**\n * Answer the requests under a received route by consuming them from the session, pinned to the\n * route's identity: the session may carry another identity's claim at the prefix, which ranks\n * apart from this one, and must never be served under this one's identity.\n */\nasync function drive(handle: Claim, conn: Session): Promise<void> {\n\tconst session = wireOf(conn);\n\ttry {\n\t\tfor await (const request of handle.requested()) {\n\t\t\t// Read per request: a handover may update the handle in place.\n\t\t\trequest.serve(session.consume(request.path, wireOf(handle).info?.identity));\n\t\t}\n\t} catch {\n\t\thandle.close();\n\t}\n}\n\n/**\n * Answer the origin's open requests with blind subscriptions for the session's lifetime.\n *\n * Every session answers, discovery or not: subscribing to an unannounced path is always\n * legal, and a missing broadcast surfaces as a reset on the first track. The first session\n * to answer wins; when this session dies its answers are withdrawn, and the requests they\n * resolved end with it, since a later session is another publisher identity.\n *\n * A path the table already routes is left alone. A request resolves to the table's route over\n * any blind answer, so answering one would only park a handle nothing reads.\n */\nasync function serveRequests(conn: Session, origin: OriginProducer): Promise<void> {\n\tconst table = wireOf(origin);\n\tconst session = wireOf(conn);\n\t// The withdraws for the answers this session provided, so a dead session only takes\n\t// back its own. Keyed by path but remembering the slot, because a path outlives its\n\t// slot: the last handle closing tears the slot down and a new request installs a fresh\n\t// one, and those two writes coalesce into a single wakeup. Matching on the path alone\n\t// would read the new slot as already answered and leave it unanswered forever.\n\tconst answered = new Map<Path.Valid, { slot: RequestSlot; withdraw: Dispose }>();\n\n\tlet dead = false;\n\tconst closed = conn.closed.then(() => {\n\t\tdead = true;\n\t});\n\n\tfor (;;) {\n\t\tconst map = table.requests.peek();\n\t\tif (origin.closed.peek() !== undefined || dead) break;\n\n\t\tfor (const [path, slot] of map) {\n\t\t\tif (!table.blind(slot)) continue;\n\t\t\tif (answered.get(path)?.slot === slot || slot.answer !== undefined) continue;\n\t\t\tif (table.routes(path)) continue;\n\t\t\tconst withdraw = table.answer(path, session.consume(path));\n\t\t\tif (withdraw) answered.set(path, { slot, withdraw });\n\t\t}\n\n\t\t// A withdrawn request already released the answer; just forget our claim on the path.\n\t\t// A replaced slot counts as withdrawn: the answer we hold belongs to the slot that\n\t\t// went away, not to whatever now occupies the path.\n\t\tfor (const [path, entry] of [...answered]) {\n\t\t\tif (map.get(path) === entry.slot && table.blind(entry.slot)) continue;\n\t\t\tanswered.delete(path);\n\t\t\tentry.withdraw();\n\t\t}\n\n\t\t// Woken by the table too, not just the requests: a path that stops being routed needs\n\t\t// the blind answer this loop skipped while it was.\n\t\tawait race([table.changed(), closed]);\n\t}\n\n\t// Session gone: withdraw our answers, waking a standby session to provide fresh ones.\n\tfor (const { withdraw } of answered.values()) {\n\t\twithdraw();\n\t}\n\tanswered.clear();\n}\n"]}
|
package/connection/goaway.d.ts
CHANGED
|
@@ -1,25 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* GOAWAY handling for the reconnect loop: the peer's drain signal and the policy for the
|
|
3
|
+
* redirect it may name. Mirrors `Handover` and `Redirect` in `moq_net::reconnect`.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { Duration } from "@moq/clock";
|
|
2
8
|
/** A peer's GOAWAY as a session received it. */
|
|
3
|
-
export interface
|
|
9
|
+
export interface Goaway {
|
|
4
10
|
/** Where to reconnect, including any credentials it needs. Empty means the same endpoint. */
|
|
5
11
|
readonly uri: string;
|
|
6
12
|
/** When the peer force-closes the session. Undefined when the wire carried none. */
|
|
7
|
-
readonly timeout?:
|
|
13
|
+
readonly timeout?: Duration;
|
|
8
14
|
}
|
|
9
15
|
/**
|
|
10
16
|
* What to do with the URI a peer names in its GOAWAY.
|
|
11
17
|
*
|
|
12
18
|
* - `same-host` (the default) follows it only onto the host already dialed, so a peer can move
|
|
13
19
|
* the connection between ports or schemes but not to another host.
|
|
14
|
-
* - `follow` also lets the peer name the host. The name is dialed as written,
|
|
15
|
-
*
|
|
20
|
+
* - `follow` also lets the peer name the host. The name is dialed as written, and the new host
|
|
21
|
+
* is presented every token on the connection's `auth` handle, so only use it with a relay
|
|
22
|
+
* trusted not to point the connection into the local network or at an untrusted host.
|
|
16
23
|
* - `ignore` reconnects to the current URL whatever the peer names.
|
|
17
24
|
*
|
|
18
25
|
* A malformed or refused URI ends the connection with {@link RefusedRedirect}.
|
|
19
26
|
*/
|
|
20
27
|
export type Redirect = "follow" | "same-host" | "ignore";
|
|
21
|
-
/** How a reconnecting connection
|
|
22
|
-
export interface
|
|
28
|
+
/** How a reconnecting connection hands over to a new session after a peer's GOAWAY. */
|
|
29
|
+
export interface Handover {
|
|
23
30
|
/** What to do with the URI the peer names (default: `same-host`). */
|
|
24
31
|
redirect?: Redirect;
|
|
25
32
|
/**
|
|
@@ -27,8 +34,8 @@ export interface GoawayProps {
|
|
|
27
34
|
* (default: 10000ms). A cap: a shorter deadline from the peer wins, a longer one does not
|
|
28
35
|
* extend it.
|
|
29
36
|
*/
|
|
30
|
-
handover?:
|
|
37
|
+
handover?: Duration;
|
|
31
38
|
}
|
|
32
39
|
/** The handover cap when the caller names none. */
|
|
33
|
-
export declare const DEFAULT_HANDOVER:
|
|
40
|
+
export declare const DEFAULT_HANDOVER: Duration;
|
|
34
41
|
//# sourceMappingURL=goaway.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goaway.d.ts","sourceRoot":"","sources":["../../src/connection/goaway.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"goaway.d.ts","sourceRoot":"","sources":["../../src/connection/goaway.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC,gDAAgD;AAChD,MAAM,WAAW,MAAM;IACtB,6FAA6F;IAC7F,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,oFAAoF;IACpF,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEzD,uFAAuF;AACvF,MAAM,WAAW,QAAQ;IACxB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACpB;AAED,mDAAmD;AACnD,eAAO,MAAM,gBAAgB,UAA0B,CAAC"}
|
package/connection/goaway.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GOAWAY handling for the reconnect loop: the peer's drain signal and the policy for the
|
|
3
|
-
* redirect it may name. Mirrors `
|
|
3
|
+
* redirect it may name. Mirrors `Handover` and `Redirect` in `moq_net::reconnect`.
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
+
import { Duration } from "@moq/clock";
|
|
7
8
|
import { RefusedRedirect } from "../error.js";
|
|
8
|
-
import
|
|
9
|
+
import { isLocal, parse, sameHost } from "./endpoint.js";
|
|
9
10
|
/** The handover cap when the caller names none. */
|
|
10
|
-
export const DEFAULT_HANDOVER =
|
|
11
|
+
export const DEFAULT_HANDOVER = Duration.millis(10_000);
|
|
11
12
|
/**
|
|
12
13
|
* How long a drained session may keep serving: the cap, lowered to the peer's deadline when
|
|
13
14
|
* it named a positive one. Absence is not a zero-length handover.
|
|
@@ -15,7 +16,7 @@ export const DEFAULT_HANDOVER = Time.Milli(10_000);
|
|
|
15
16
|
* @internal
|
|
16
17
|
*/
|
|
17
18
|
export function handover(cap, timeout) {
|
|
18
|
-
return timeout !== undefined && timeout
|
|
19
|
+
return timeout !== undefined && !timeout.isZero() ? cap.min(timeout) : cap;
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
* The URL a redirect is judged against. A WebSocket fallback that won the race is the host
|
|
@@ -52,138 +53,51 @@ export function target(policy, uri, current, pinned) {
|
|
|
52
53
|
// Parse before `ignore`: a malformed redirect is terminal even when the policy
|
|
53
54
|
// would otherwise stay on the current URL.
|
|
54
55
|
let next;
|
|
56
|
+
let to;
|
|
55
57
|
try {
|
|
56
58
|
next = new URL(uri);
|
|
59
|
+
to = parse(next);
|
|
57
60
|
}
|
|
58
61
|
catch {
|
|
59
62
|
throw new RefusedRedirect("the GOAWAY URI is malformed");
|
|
60
63
|
}
|
|
61
64
|
if (policy === "ignore")
|
|
62
65
|
return undefined;
|
|
63
|
-
|
|
66
|
+
const from = parse(current);
|
|
67
|
+
if (schemeTier(to.scheme) < schemeTier(from.scheme)) {
|
|
64
68
|
throw new RefusedRedirect("the GOAWAY redirect downgrades the scheme");
|
|
65
69
|
}
|
|
66
70
|
// Only as far as the URL itself says: a name is dialed, never resolved here, so this
|
|
67
71
|
// refuses a peer naming a local address outright, not one hiding it behind a hostname.
|
|
68
72
|
// That gap is why `same-host` is the default.
|
|
69
|
-
if (isLocal(
|
|
73
|
+
if (isLocal(to) && !isLocal(from)) {
|
|
70
74
|
throw new RefusedRedirect("the GOAWAY redirect widens reachability to a local address");
|
|
71
75
|
}
|
|
72
76
|
// Host only, not the full authority: the port is what a peer legitimately moves us
|
|
73
77
|
// across when it hands off to a sibling process on the same box.
|
|
74
|
-
const
|
|
75
|
-
if (policy === "same-host" && !
|
|
78
|
+
const same = sameHost(to, from);
|
|
79
|
+
if (policy === "same-host" && !same) {
|
|
76
80
|
throw new RefusedRedirect("the GOAWAY redirect leaves the current host");
|
|
77
81
|
}
|
|
78
|
-
if (pinned && !
|
|
82
|
+
if (pinned && !same) {
|
|
79
83
|
throw new RefusedRedirect("the GOAWAY redirect leaves the host a certificate pin verifies");
|
|
80
84
|
}
|
|
81
85
|
return next;
|
|
82
86
|
}
|
|
83
87
|
/** Rank a scheme so a redirect cannot silently drop encryption; unknown schemes rank lowest. */
|
|
84
|
-
function schemeTier(
|
|
85
|
-
switch (
|
|
86
|
-
case "https
|
|
87
|
-
case "wss
|
|
88
|
-
case "moqt
|
|
89
|
-
case "moql
|
|
88
|
+
function schemeTier(scheme) {
|
|
89
|
+
switch (scheme) {
|
|
90
|
+
case "https":
|
|
91
|
+
case "wss":
|
|
92
|
+
case "moqt":
|
|
93
|
+
case "moql":
|
|
90
94
|
return 2;
|
|
91
|
-
case "http
|
|
92
|
-
case "ws
|
|
93
|
-
case "tcp
|
|
95
|
+
case "http":
|
|
96
|
+
case "ws":
|
|
97
|
+
case "tcp":
|
|
94
98
|
return 1;
|
|
95
99
|
default:
|
|
96
100
|
return 0;
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
|
-
/**
|
|
100
|
-
* Whether a URL says it names something only reachable from this host or network. A judgement
|
|
101
|
-
* about the URL, not about where a dial lands: `false` means "not local on its face".
|
|
102
|
-
*
|
|
103
|
-
* @internal
|
|
104
|
-
*/
|
|
105
|
-
export function isLocal(url) {
|
|
106
|
-
let host = url.hostname.toLowerCase();
|
|
107
|
-
// A non-special scheme (`moqt:`) keeps its host opaque; reading it back through
|
|
108
|
-
// https decodes every IPv4 spelling the dial accepts (`127.1`, `0x7f000001`).
|
|
109
|
-
if (host !== "" && !host.startsWith("[") && !SPECIAL.has(url.protocol)) {
|
|
110
|
-
try {
|
|
111
|
-
host = new URL(`https://${host}/`).hostname;
|
|
112
|
-
}
|
|
113
|
-
catch {
|
|
114
|
-
// Not a valid special host, so not an address literal either.
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
// A trailing dot names the same host.
|
|
118
|
-
if (host.endsWith("."))
|
|
119
|
-
host = host.slice(0, -1);
|
|
120
|
-
// No host at all, e.g. a `unix:` socket path.
|
|
121
|
-
if (host === "")
|
|
122
|
-
return true;
|
|
123
|
-
if (host === "localhost" || host.endsWith(".localhost"))
|
|
124
|
-
return true;
|
|
125
|
-
if (host.startsWith("[") && host.endsWith("]")) {
|
|
126
|
-
const segments = parseIpv6(host.slice(1, -1));
|
|
127
|
-
return segments !== undefined && isLocalV6(segments);
|
|
128
|
-
}
|
|
129
|
-
const v4 = parseIpv4(host);
|
|
130
|
-
return v4 !== undefined && isLocalV4(v4);
|
|
131
|
-
}
|
|
132
|
-
const SPECIAL = new Set(["http:", "https:", "ws:", "wss:", "ftp:", "file:"]);
|
|
133
|
-
function parseIpv4(host) {
|
|
134
|
-
const parts = host.split(".");
|
|
135
|
-
if (parts.length !== 4)
|
|
136
|
-
return undefined;
|
|
137
|
-
const octets = parts.map((part) => (/^\d{1,3}$/.test(part) ? Number(part) : Number.NaN));
|
|
138
|
-
return octets.every((octet) => octet <= 255) ? octets : undefined;
|
|
139
|
-
}
|
|
140
|
-
function isLocalV4([a, b, c, d]) {
|
|
141
|
-
return (a === 127 ||
|
|
142
|
-
a === 10 ||
|
|
143
|
-
(a === 172 && b >= 16 && b <= 31) ||
|
|
144
|
-
(a === 192 && b === 168) ||
|
|
145
|
-
(a === 169 && b === 254) ||
|
|
146
|
-
(a === 0 && b === 0 && c === 0 && d === 0));
|
|
147
|
-
}
|
|
148
|
-
/** Parse an IPv6 literal (without brackets) into its eight 16-bit segments. */
|
|
149
|
-
function parseIpv6(host) {
|
|
150
|
-
// Drop a zone id; it scopes the address without changing it.
|
|
151
|
-
let text = host.split("%")[0] ?? "";
|
|
152
|
-
// A trailing dotted quad (`::ffff:127.0.0.1`) spells the last two segments.
|
|
153
|
-
const lastColon = text.lastIndexOf(":");
|
|
154
|
-
const quad = parseIpv4(text.slice(lastColon + 1));
|
|
155
|
-
if (quad) {
|
|
156
|
-
const [a = 0, b = 0, c = 0, d = 0] = quad;
|
|
157
|
-
const word = (hi, lo) => ((hi << 8) | lo).toString(16);
|
|
158
|
-
text = `${text.slice(0, lastColon + 1)}${word(a, b)}:${word(c, d)}`;
|
|
159
|
-
}
|
|
160
|
-
const halves = text.split("::");
|
|
161
|
-
if (halves.length > 2)
|
|
162
|
-
return undefined;
|
|
163
|
-
const words = (part) => (part === "" ? [] : part.split(":"));
|
|
164
|
-
const head = words(halves[0] ?? "");
|
|
165
|
-
const rest = halves.length === 2 ? words(halves[1] ?? "") : [];
|
|
166
|
-
const missing = 8 - head.length - rest.length;
|
|
167
|
-
if (halves.length === 2 ? missing < 0 : missing !== 0)
|
|
168
|
-
return undefined;
|
|
169
|
-
const all = [...head, ...Array(missing).fill("0"), ...rest];
|
|
170
|
-
const segments = all.map((word) => (/^[0-9a-f]{1,4}$/i.test(word) ? Number.parseInt(word, 16) : Number.NaN));
|
|
171
|
-
return segments.some(Number.isNaN) ? undefined : segments;
|
|
172
|
-
}
|
|
173
|
-
function isLocalV6(segments) {
|
|
174
|
-
// An IPv4-mapped address reaches the same host as the v4 it wraps.
|
|
175
|
-
if (segments.slice(0, 5).every((s) => s === 0) && segments[5] === 0xffff) {
|
|
176
|
-
const [hi = 0, lo = 0] = segments.slice(6);
|
|
177
|
-
return isLocalV4([hi >> 8, hi & 0xff, lo >> 8, lo & 0xff]);
|
|
178
|
-
}
|
|
179
|
-
const first = segments[0] ?? 0;
|
|
180
|
-
const zeroPrefix = segments.slice(0, 7).every((s) => s === 0);
|
|
181
|
-
const last = segments[7] ?? 0;
|
|
182
|
-
return (
|
|
183
|
-
// Loopback (::1) and unspecified (::).
|
|
184
|
-
(zeroPrefix && (last === 1 || last === 0)) ||
|
|
185
|
-
// Unique local (fc00::/7) and link local (fe80::/10).
|
|
186
|
-
(first & 0xfe00) === 0xfc00 ||
|
|
187
|
-
(first & 0xffc0) === 0xfe80);
|
|
188
|
-
}
|
|
189
103
|
//# sourceMappingURL=goaway.js.map
|
package/connection/goaway.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goaway.js","sourceRoot":"","sources":["../../src/connection/goaway.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AAoCnC,mDAAmD;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAe,EAAE,OAAoB;IAC7D,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AACxF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,OAAY,EAAE,SAAuC,EAAE,SAAe;IAC5F,OAAO,SAA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Q,CAAC;AAC3D,CAAC;AAED,SAAS,SAAS,CAAC,QAAkB;IACpC,mEAAmE;IACnE,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE,CAAC;QAC1E,MAAM,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3C,OAAO,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IAC5D,CAAC;IACD,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9D,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO;IACN,uCAAuC;IACvC,CAAC,UAAU,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC;QAC1C,sDAAsD;QACtD,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,MAAM;QAC3B,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,MAAM,CAC3B,CAAC;AACH,CAAC","sourcesContent":["/**\n * GOAWAY handling for the reconnect loop: the peer's drain signal and the policy for the\n * redirect it may name. Mirrors `Goaway` and `Redirect` in `moq_tokio::connection`.\n *\n * @module\n */\nimport { RefusedRedirect } from \"../error.ts\";\nimport * as Time from \"../time.ts\";\n\n/** A peer's GOAWAY as a session received it. */\nexport interface Drain {\n\t/** Where to reconnect, including any credentials it needs. Empty means the same endpoint. */\n\treadonly uri: string;\n\t/** When the peer force-closes the session. Undefined when the wire carried none. */\n\treadonly timeout?: Time.Milli;\n}\n\n/**\n * What to do with the URI a peer names in its GOAWAY.\n *\n * - `same-host` (the default) follows it only onto the host already dialed, so a peer can move\n * the connection between ports or schemes but not to another host.\n * - `follow` also lets the peer name the host. The name is dialed as written, so only use it\n * with a relay trusted not to point the connection into the local network.\n * - `ignore` reconnects to the current URL whatever the peer names.\n *\n * A malformed or refused URI ends the connection with {@link RefusedRedirect}.\n */\nexport type Redirect = \"follow\" | \"same-host\" | \"ignore\";\n\n/** How a reconnecting connection reacts to a peer's GOAWAY. */\nexport interface GoawayProps {\n\t/** What to do with the URI the peer names (default: `same-host`). */\n\tredirect?: Redirect;\n\n\t/**\n\t * How long the old session keeps serving after the GOAWAY while the replacement dials\n\t * (default: 10000ms). A cap: a shorter deadline from the peer wins, a longer one does not\n\t * extend it.\n\t */\n\thandover?: Time.Milli;\n}\n\n/** The handover cap when the caller names none. */\nexport const DEFAULT_HANDOVER = Time.Milli(10_000);\n\n/**\n * How long a drained session may keep serving: the cap, lowered to the peer's deadline when\n * it named a positive one. Absence is not a zero-length handover.\n *\n * @internal\n */\nexport function handover(cap: Time.Milli, timeout?: Time.Milli): Time.Milli {\n\treturn timeout !== undefined && timeout > 0 ? Time.Milli(Math.min(cap, timeout)) : cap;\n}\n\n/**\n * The URL a redirect is judged against. A WebSocket fallback that won the race is the host\n * we dialed; the primary URL was not, so same-host must not treat it as the current peer.\n *\n * @internal\n */\nexport function dialed(primary: URL, transport: \"webtransport\" | \"websocket\", websocket?: URL): URL {\n\treturn transport === \"websocket\" && websocket ? websocket : primary;\n}\n\n/**\n * Whether a certificate pin constrains this session. The pin is a WebTransport option, so it\n * holds the host only when that transport is the one that connected.\n *\n * @internal\n */\nexport function pinnedTransport(transport: \"webtransport\" | \"websocket\", configured: boolean): boolean {\n\treturn configured && transport === \"webtransport\";\n}\n\n/**\n * The URL a GOAWAY assigns: `undefined` keeps the current URL (the peer named none, or the\n * policy ignores a URI it could parse), and a URL replaces it. Throws {@link RefusedRedirect}\n * for an explicit URI the policy will not follow, including a malformed one under `ignore`.\n *\n * `pinned` is a certificate pin on the connection, which can only verify the host it was\n * configured for, so it refuses a host change even under `follow`.\n *\n * @internal\n */\nexport function target(policy: Redirect, uri: string, current: URL, pinned: boolean): URL | undefined {\n\tif (uri === \"\") return undefined;\n\n\t// The URI can carry credentials, so the error names the reason, never the URI.\n\t// Parse before `ignore`: a malformed redirect is terminal even when the policy\n\t// would otherwise stay on the current URL.\n\tlet next: URL;\n\ttry {\n\t\tnext = new URL(uri);\n\t} catch {\n\t\tthrow new RefusedRedirect(\"the GOAWAY URI is malformed\");\n\t}\n\tif (policy === \"ignore\") return undefined;\n\n\tif (schemeTier(next.protocol) < schemeTier(current.protocol)) {\n\t\tthrow new RefusedRedirect(\"the GOAWAY redirect downgrades the scheme\");\n\t}\n\n\t// Only as far as the URL itself says: a name is dialed, never resolved here, so this\n\t// refuses a peer naming a local address outright, not one hiding it behind a hostname.\n\t// That gap is why `same-host` is the default.\n\tif (isLocal(next) && !isLocal(current)) {\n\t\tthrow new RefusedRedirect(\"the GOAWAY redirect widens reachability to a local address\");\n\t}\n\n\t// Host only, not the full authority: the port is what a peer legitimately moves us\n\t// across when it hands off to a sibling process on the same box.\n\tconst sameHost = next.hostname === current.hostname;\n\tif (policy === \"same-host\" && !sameHost) {\n\t\tthrow new RefusedRedirect(\"the GOAWAY redirect leaves the current host\");\n\t}\n\tif (pinned && !sameHost) {\n\t\tthrow new RefusedRedirect(\"the GOAWAY redirect leaves the host a certificate pin verifies\");\n\t}\n\n\treturn next;\n}\n\n/** Rank a scheme so a redirect cannot silently drop encryption; unknown schemes rank lowest. */\nfunction schemeTier(protocol: string): number {\n\tswitch (protocol) {\n\t\tcase \"https:\":\n\t\tcase \"wss:\":\n\t\tcase \"moqt:\":\n\t\tcase \"moql:\":\n\t\t\treturn 2;\n\t\tcase \"http:\":\n\t\tcase \"ws:\":\n\t\tcase \"tcp:\":\n\t\t\treturn 1;\n\t\tdefault:\n\t\t\treturn 0;\n\t}\n}\n\n/**\n * Whether a URL says it names something only reachable from this host or network. A judgement\n * about the URL, not about where a dial lands: `false` means \"not local on its face\".\n *\n * @internal\n */\nexport function isLocal(url: URL): boolean {\n\tlet host = url.hostname.toLowerCase();\n\t// A non-special scheme (`moqt:`) keeps its host opaque; reading it back through\n\t// https decodes every IPv4 spelling the dial accepts (`127.1`, `0x7f000001`).\n\tif (host !== \"\" && !host.startsWith(\"[\") && !SPECIAL.has(url.protocol)) {\n\t\ttry {\n\t\t\thost = new URL(`https://${host}/`).hostname;\n\t\t} catch {\n\t\t\t// Not a valid special host, so not an address literal either.\n\t\t}\n\t}\n\t// A trailing dot names the same host.\n\tif (host.endsWith(\".\")) host = host.slice(0, -1);\n\t// No host at all, e.g. a `unix:` socket path.\n\tif (host === \"\") return true;\n\tif (host === \"localhost\" || host.endsWith(\".localhost\")) return true;\n\n\tif (host.startsWith(\"[\") && host.endsWith(\"]\")) {\n\t\tconst segments = parseIpv6(host.slice(1, -1));\n\t\treturn segments !== undefined && isLocalV6(segments);\n\t}\n\n\tconst v4 = parseIpv4(host);\n\treturn v4 !== undefined && isLocalV4(v4);\n}\n\nconst SPECIAL = new Set([\"http:\", \"https:\", \"ws:\", \"wss:\", \"ftp:\", \"file:\"]);\n\nfunction parseIpv4(host: string): number[] | undefined {\n\tconst parts = host.split(\".\");\n\tif (parts.length !== 4) return undefined;\n\tconst octets = parts.map((part) => (/^\\d{1,3}$/.test(part) ? Number(part) : Number.NaN));\n\treturn octets.every((octet) => octet <= 255) ? octets : undefined;\n}\n\nfunction isLocalV4([a, b, c, d]: number[]): boolean {\n\treturn (\n\t\ta === 127 ||\n\t\ta === 10 ||\n\t\t(a === 172 && b >= 16 && b <= 31) ||\n\t\t(a === 192 && b === 168) ||\n\t\t(a === 169 && b === 254) ||\n\t\t(a === 0 && b === 0 && c === 0 && d === 0)\n\t);\n}\n\n/** Parse an IPv6 literal (without brackets) into its eight 16-bit segments. */\nfunction parseIpv6(host: string): number[] | undefined {\n\t// Drop a zone id; it scopes the address without changing it.\n\tlet text = host.split(\"%\")[0] ?? \"\";\n\n\t// A trailing dotted quad (`::ffff:127.0.0.1`) spells the last two segments.\n\tconst lastColon = text.lastIndexOf(\":\");\n\tconst quad = parseIpv4(text.slice(lastColon + 1));\n\tif (quad) {\n\t\tconst [a = 0, b = 0, c = 0, d = 0] = quad;\n\t\tconst word = (hi: number, lo: number) => ((hi << 8) | lo).toString(16);\n\t\ttext = `${text.slice(0, lastColon + 1)}${word(a, b)}:${word(c, d)}`;\n\t}\n\n\tconst halves = text.split(\"::\");\n\tif (halves.length > 2) return undefined;\n\tconst words = (part: string) => (part === \"\" ? [] : part.split(\":\"));\n\tconst head = words(halves[0] ?? \"\");\n\tconst rest = halves.length === 2 ? words(halves[1] ?? \"\") : [];\n\tconst missing = 8 - head.length - rest.length;\n\tif (halves.length === 2 ? missing < 0 : missing !== 0) return undefined;\n\n\tconst all = [...head, ...Array<string>(missing).fill(\"0\"), ...rest];\n\tconst segments = all.map((word) => (/^[0-9a-f]{1,4}$/i.test(word) ? Number.parseInt(word, 16) : Number.NaN));\n\treturn segments.some(Number.isNaN) ? undefined : segments;\n}\n\nfunction isLocalV6(segments: number[]): boolean {\n\t// An IPv4-mapped address reaches the same host as the v4 it wraps.\n\tif (segments.slice(0, 5).every((s) => s === 0) && segments[5] === 0xffff) {\n\t\tconst [hi = 0, lo = 0] = segments.slice(6);\n\t\treturn isLocalV4([hi >> 8, hi & 0xff, lo >> 8, lo & 0xff]);\n\t}\n\tconst first = segments[0] ?? 0;\n\tconst zeroPrefix = segments.slice(0, 7).every((s) => s === 0);\n\tconst last = segments[7] ?? 0;\n\treturn (\n\t\t// Loopback (::1) and unspecified (::).\n\t\t(zeroPrefix && (last === 1 || last === 0)) ||\n\t\t// Unique local (fc00::/7) and link local (fe80::/10).\n\t\t(first & 0xfe00) === 0xfc00 ||\n\t\t(first & 0xffc0) === 0xfe80\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"goaway.js","sourceRoot":"","sources":["../../src/connection/goaway.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAiB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAsCxE,mDAAmD;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAExD;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAa,EAAE,OAAkB;IACzD,OAAO,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAC5E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,OAAY,EAAE,SAAoB,EAAE,SAAe;IACzE,OAAO,SAAS,KAAK,WAAW,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;AACrE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,SAAoB,EAAE,UAAmB;IACxE,OAAO,UAAU,IAAI,SAAS,KAAK,cAAc,CAAC;AACnD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,MAAM,CAAC,MAAgB,EAAE,GAAW,EAAE,OAAY,EAAE,MAAe;IAClF,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAEjC,+EAA+E;IAC/E,+EAA+E;IAC/E,2CAA2C;IAC3C,IAAI,IAA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AM;YACV,OAAO,CAAC,CAAC;QACV,KAAK,MAAM,CAAC;QACZ,KAAK,IAAI,CAAC;QACV,KAAK,KAAK;YACT,OAAO,CAAC,CAAC;QACV;YACC,OAAO,CAAC,CAAC;IACX,CAAC;AACF,CAAC","sourcesContent":["/**\n * GOAWAY handling for the reconnect loop: the peer's drain signal and the policy for the\n * redirect it may name. Mirrors `Handover` and `Redirect` in `moq_net::reconnect`.\n *\n * @module\n */\n\nimport { Duration } from \"@moq/clock\";\nimport { RefusedRedirect } from \"../error.ts\";\nimport { type Endpoint, isLocal, parse, sameHost } from \"./endpoint.ts\";\nimport type { Transport } from \"./transport.ts\";\n\n/** A peer's GOAWAY as a session received it. */\nexport interface Goaway {\n\t/** Where to reconnect, including any credentials it needs. Empty means the same endpoint. */\n\treadonly uri: string;\n\t/** When the peer force-closes the session. Undefined when the wire carried none. */\n\treadonly timeout?: Duration;\n}\n\n/**\n * What to do with the URI a peer names in its GOAWAY.\n *\n * - `same-host` (the default) follows it only onto the host already dialed, so a peer can move\n * the connection between ports or schemes but not to another host.\n * - `follow` also lets the peer name the host. The name is dialed as written, and the new host\n * is presented every token on the connection's `auth` handle, so only use it with a relay\n * trusted not to point the connection into the local network or at an untrusted host.\n * - `ignore` reconnects to the current URL whatever the peer names.\n *\n * A malformed or refused URI ends the connection with {@link RefusedRedirect}.\n */\nexport type Redirect = \"follow\" | \"same-host\" | \"ignore\";\n\n/** How a reconnecting connection hands over to a new session after a peer's GOAWAY. */\nexport interface Handover {\n\t/** What to do with the URI the peer names (default: `same-host`). */\n\tredirect?: Redirect;\n\n\t/**\n\t * How long the old session keeps serving after the GOAWAY while the replacement dials\n\t * (default: 10000ms). A cap: a shorter deadline from the peer wins, a longer one does not\n\t * extend it.\n\t */\n\thandover?: Duration;\n}\n\n/** The handover cap when the caller names none. */\nexport const DEFAULT_HANDOVER = Duration.millis(10_000);\n\n/**\n * How long a drained session may keep serving: the cap, lowered to the peer's deadline when\n * it named a positive one. Absence is not a zero-length handover.\n *\n * @internal\n */\nexport function handover(cap: Duration, timeout?: Duration): Duration {\n\treturn timeout !== undefined && !timeout.isZero() ? cap.min(timeout) : cap;\n}\n\n/**\n * The URL a redirect is judged against. A WebSocket fallback that won the race is the host\n * we dialed; the primary URL was not, so same-host must not treat it as the current peer.\n *\n * @internal\n */\nexport function dialed(primary: URL, transport: Transport, websocket?: URL): URL {\n\treturn transport === \"websocket\" && websocket ? websocket : primary;\n}\n\n/**\n * Whether a certificate pin constrains this session. The pin is a WebTransport option, so it\n * holds the host only when that transport is the one that connected.\n *\n * @internal\n */\nexport function pinnedTransport(transport: Transport, configured: boolean): boolean {\n\treturn configured && transport === \"webtransport\";\n}\n\n/**\n * The URL a GOAWAY assigns: `undefined` keeps the current URL (the peer named none, or the\n * policy ignores a URI it could parse), and a URL replaces it. Throws {@link RefusedRedirect}\n * for an explicit URI the policy will not follow, including a malformed one under `ignore`.\n *\n * `pinned` is a certificate pin on the connection, which can only verify the host it was\n * configured for, so it refuses a host change even under `follow`.\n *\n * @internal\n */\nexport function target(policy: Redirect, uri: string, current: URL, pinned: boolean): URL | undefined {\n\tif (uri === \"\") return undefined;\n\n\t// The URI can carry credentials, so the error names the reason, never the URI.\n\t// Parse before `ignore`: a malformed redirect is terminal even when the policy\n\t// would otherwise stay on the current URL.\n\tlet next: URL;\n\tlet to: Endpoint;\n\ttry {\n\t\tnext = new URL(uri);\n\t\tto = parse(next);\n\t} catch {\n\t\tthrow new RefusedRedirect(\"the GOAWAY URI is malformed\");\n\t}\n\tif (policy === \"ignore\") return undefined;\n\tconst from = parse(current);\n\n\tif (schemeTier(to.scheme) < schemeTier(from.scheme)) {\n\t\tthrow new RefusedRedirect(\"the GOAWAY redirect downgrades the scheme\");\n\t}\n\n\t// Only as far as the URL itself says: a name is dialed, never resolved here, so this\n\t// refuses a peer naming a local address outright, not one hiding it behind a hostname.\n\t// That gap is why `same-host` is the default.\n\tif (isLocal(to) && !isLocal(from)) {\n\t\tthrow new RefusedRedirect(\"the GOAWAY redirect widens reachability to a local address\");\n\t}\n\n\t// Host only, not the full authority: the port is what a peer legitimately moves us\n\t// across when it hands off to a sibling process on the same box.\n\tconst same = sameHost(to, from);\n\tif (policy === \"same-host\" && !same) {\n\t\tthrow new RefusedRedirect(\"the GOAWAY redirect leaves the current host\");\n\t}\n\tif (pinned && !same) {\n\t\tthrow new RefusedRedirect(\"the GOAWAY redirect leaves the host a certificate pin verifies\");\n\t}\n\n\treturn next;\n}\n\n/** Rank a scheme so a redirect cannot silently drop encryption; unknown schemes rank lowest. */\nfunction schemeTier(scheme: string): number {\n\tswitch (scheme) {\n\t\tcase \"https\":\n\t\tcase \"wss\":\n\t\tcase \"moqt\":\n\t\tcase \"moql\":\n\t\t\treturn 2;\n\t\tcase \"http\":\n\t\tcase \"ws\":\n\t\tcase \"tcp\":\n\t\t\treturn 1;\n\t\tdefault:\n\t\t\treturn 0;\n\t}\n}\n"]}
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
+
import { Cost } from "../hop.ts";
|
|
1
2
|
import * as Ietf from "../ietf/index.ts";
|
|
3
|
+
import * as Lite from "../lite/index.ts";
|
|
4
|
+
import type { Producer as OriginProducer } from "../origin.ts";
|
|
2
5
|
import { Reader, Stream } from "../stream.ts";
|
|
6
|
+
/** The price and rank a session puts on its link: the `cost` option, and its `consume` origin's priority. */
|
|
7
|
+
export interface Link {
|
|
8
|
+
cost?: Cost;
|
|
9
|
+
priority?: number;
|
|
10
|
+
}
|
|
11
|
+
/** Refuse a link price no wire carries, before anything opens. */
|
|
12
|
+
export declare function checkCost(cost: Cost | undefined): void;
|
|
13
|
+
/** The link a session's options price and rank. */
|
|
14
|
+
export declare function link({ cost, consume }: {
|
|
15
|
+
cost?: Cost;
|
|
16
|
+
consume?: OriginProducer;
|
|
17
|
+
}): Link;
|
|
3
18
|
/**
|
|
4
|
-
* Draft-
|
|
19
|
+
* Draft-18+ SETUP exchange. Each side opens a uni stream, writes its Setup
|
|
5
20
|
* message, and reads the peer's Setup off an incoming uni stream. The two
|
|
6
21
|
* halves run in parallel and the protocol is symmetric, so both `connect`
|
|
7
22
|
* (client) and `accept` (server) use this same function.
|
|
@@ -9,16 +24,27 @@ import { Reader, Stream } from "../stream.ts";
|
|
|
9
24
|
* Returns the control stream, the uni streams that arrived before it (see
|
|
10
25
|
* {@link receiveSetup}), plus what the peer's SETUP declared: whether it requires
|
|
11
26
|
* solicitation, which decides whether we announce namespaces unprompted (see the MoQ Solicit
|
|
12
|
-
* extension)
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
27
|
+
* extension) and its Hop ID (see the MoQ Cluster extension), plus the implementation it
|
|
28
|
+
* advertised. We declare our Hop ID and Solicit on every session: we send
|
|
29
|
+
* SUBSCRIBE_NAMESPACE for each prefix we want, so an unsolicited advertisement
|
|
30
|
+
* can tell us nothing we won't have asked for, and a peer that knows our Hop ID can withhold
|
|
31
|
+
* the advertisements that already flowed through us.
|
|
16
32
|
*/
|
|
17
|
-
export declare function exchangeSetup(transport: WebTransport, version: Ietf.IetfVersion, implementation: string
|
|
33
|
+
export declare function exchangeSetup(transport: WebTransport, version: Ietf.IetfVersion, implementation: string, { client, token, cost, }: {
|
|
34
|
+
client: boolean;
|
|
35
|
+
token?: Uint8Array;
|
|
36
|
+
/** Our price for this link, declared as RELAY_COST and winning over the peer's. */
|
|
37
|
+
cost?: Cost;
|
|
38
|
+
}): Promise<{
|
|
18
39
|
control: Stream;
|
|
19
40
|
early: Reader[];
|
|
20
41
|
solicit: boolean | undefined;
|
|
21
42
|
hidden: boolean;
|
|
43
|
+
activeCount: boolean;
|
|
22
44
|
cluster: Ietf.Cluster.Hops;
|
|
45
|
+
peerImplementation: string | undefined;
|
|
46
|
+
linkCost: Cost;
|
|
23
47
|
}>;
|
|
48
|
+
/** Whether SETUP selecting `version` ends the SETUP stream, the session continuing as its ALPN would. */
|
|
49
|
+
export declare function handsOff(version: Lite.Version): boolean;
|
|
24
50
|
//# sourceMappingURL=handshake.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handshake.d.ts","sourceRoot":"","sources":["../../src/connection/handshake.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAyB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"handshake.d.ts","sourceRoot":"","sources":["../../src/connection/handshake.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAuB,MAAM,WAAW,CAAC;AAEtD,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAEzC,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAgB,MAAM,EAAE,MAAM,EAAyB,MAAM,cAAc,CAAC;AAkBnF,6GAA6G;AAC7G,MAAM,WAAW,IAAI;IACpB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,kEAAkE;AAClE,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI,CAKtD;AAED,mDAAmD;AACnD,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,cAAc,CAAA;CAAE,GAAG,IAAI,CAEvF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,aAAa,CAClC,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,cAAc,EAAE,MAAM,EACtB,EACC,MAAM,EACN,KAAK,EACL,IAAI,GACJ,EAAE;IACF,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,mFAAmF;IACnF,IAAI,CAAC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