@fails-components/webtransport 0.3.0 → 1.0.0-rc.1

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.
Files changed (163) hide show
  1. package/lib/client.js +81 -40
  2. package/lib/dom.ts +7 -5
  3. package/lib/http2/browser/browser.js +168 -0
  4. package/lib/http2/browser/browserparser.js +248 -0
  5. package/lib/http2/flowcontroller.js +371 -0
  6. package/lib/http2/node/capsuleparser.js +291 -0
  7. package/lib/http2/node/client.js +239 -0
  8. package/lib/http2/node/index.js +2 -0
  9. package/lib/http2/node/server.js +499 -0
  10. package/lib/http2/node/websocketparser.js +829 -0
  11. package/lib/http2/parserbase.js +139 -0
  12. package/lib/http2/parserbasehttp2.js +128 -0
  13. package/lib/http2/session.js +225 -0
  14. package/lib/http2/stream.js +354 -0
  15. package/lib/http2/websocketcommon.js +1 -0
  16. package/lib/{index.js → index.browser.js} +6 -10
  17. package/lib/index.node.js +27 -0
  18. package/lib/server.js +252 -69
  19. package/lib/session.js +31 -68
  20. package/lib/stream.js +103 -179
  21. package/lib/types.ts +174 -87
  22. package/lib/utils.js +2 -1
  23. package/lib/webstreams.browser.js +6 -0
  24. package/lib/webstreams.js +7 -0
  25. package/lib/webtransport.browser.js +284 -0
  26. package/lib/webtransport.node.js +137 -0
  27. package/lib/{webtransport.js → webtransportbase.js} +47 -41
  28. package/old_test/test.js +31 -29
  29. package/old_test/testsuite.js +1 -1
  30. package/package.json +18 -17
  31. package/readme.md +94 -30
  32. package/test/bidirectional-streams.spec.js +51 -9
  33. package/test/datagrams.spec.js +8 -6
  34. package/test/fixtures/known-bytes.js +29 -0
  35. package/test/fixtures/read-stream.js +1 -1
  36. package/test/fixtures/reader-value.js +1 -1
  37. package/test/fixtures/server.js +24 -10
  38. package/test/fixtures/webtransport.browser.js +20 -2
  39. package/test/fixtures/webtransport.js +1 -1
  40. package/test/index.js +33 -6
  41. package/test/pw-no-https-errors.json +5 -0
  42. package/test/session.spec.js +71 -52
  43. package/test/testinone.js +2854 -0
  44. package/test/unidirectional-streams.spec.js +20 -4
  45. package/CMakeLists.txt +0 -991
  46. package/LICENSE.chromium +0 -27
  47. package/LICENSE.envoy +0 -207
  48. package/build.js +0 -313
  49. package/dist/lib/client.d.ts +0 -78
  50. package/dist/lib/client.d.ts.map +0 -1
  51. package/dist/lib/dom.d.ts +0 -87
  52. package/dist/lib/dom.d.ts.map +0 -1
  53. package/dist/lib/error.d.ts +0 -8
  54. package/dist/lib/error.d.ts.map +0 -1
  55. package/dist/lib/event-loop.d.ts +0 -33
  56. package/dist/lib/event-loop.d.ts.map +0 -1
  57. package/dist/lib/index.d.ts +0 -79
  58. package/dist/lib/index.d.ts.map +0 -1
  59. package/dist/lib/native.d.ts +0 -2
  60. package/dist/lib/native.d.ts.map +0 -1
  61. package/dist/lib/server.d.ts +0 -92
  62. package/dist/lib/server.d.ts.map +0 -1
  63. package/dist/lib/session.d.ts +0 -298
  64. package/dist/lib/session.d.ts.map +0 -1
  65. package/dist/lib/stream.d.ts +0 -135
  66. package/dist/lib/stream.d.ts.map +0 -1
  67. package/dist/lib/transport.d.ts +0 -34
  68. package/dist/lib/transport.d.ts.map +0 -1
  69. package/dist/lib/types.d.ts +0 -212
  70. package/dist/lib/types.d.ts.map +0 -1
  71. package/dist/lib/utils.d.ts +0 -11
  72. package/dist/lib/utils.d.ts.map +0 -1
  73. package/dist/lib/webtransport.d.ts +0 -47
  74. package/dist/lib/webtransport.d.ts.map +0 -1
  75. package/dist/test/bidirectional-streams.spec.d.ts +0 -5
  76. package/dist/test/bidirectional-streams.spec.d.ts.map +0 -1
  77. package/dist/test/datagrams.spec.d.ts +0 -5
  78. package/dist/test/datagrams.spec.d.ts.map +0 -1
  79. package/dist/test/event-loop.node.d.ts +0 -2
  80. package/dist/test/event-loop.node.d.ts.map +0 -1
  81. package/dist/test/fixtures/certificate.d.ts +0 -21
  82. package/dist/test/fixtures/certificate.d.ts.map +0 -1
  83. package/dist/test/fixtures/chai.d.ts +0 -2
  84. package/dist/test/fixtures/chai.d.ts.map +0 -1
  85. package/dist/test/fixtures/known-bytes.d.ts +0 -6
  86. package/dist/test/fixtures/known-bytes.d.ts.map +0 -1
  87. package/dist/test/fixtures/p-timeout.d.ts +0 -8
  88. package/dist/test/fixtures/p-timeout.d.ts.map +0 -1
  89. package/dist/test/fixtures/read-cert-hash.d.ts +0 -6
  90. package/dist/test/fixtures/read-cert-hash.d.ts.map +0 -1
  91. package/dist/test/fixtures/read-stream.d.ts +0 -19
  92. package/dist/test/fixtures/read-stream.d.ts.map +0 -1
  93. package/dist/test/fixtures/reader-value.d.ts +0 -22
  94. package/dist/test/fixtures/reader-value.d.ts.map +0 -1
  95. package/dist/test/fixtures/server.d.ts +0 -5
  96. package/dist/test/fixtures/server.d.ts.map +0 -1
  97. package/dist/test/fixtures/webtransport.browser.d.ts +0 -3
  98. package/dist/test/fixtures/webtransport.browser.d.ts.map +0 -1
  99. package/dist/test/fixtures/webtransport.d.ts +0 -3
  100. package/dist/test/fixtures/webtransport.d.ts.map +0 -1
  101. package/dist/test/fixtures/write-stream.d.ts +0 -10
  102. package/dist/test/fixtures/write-stream.d.ts.map +0 -1
  103. package/dist/test/index.d.ts +0 -2
  104. package/dist/test/index.d.ts.map +0 -1
  105. package/dist/test/session.spec.d.ts +0 -5
  106. package/dist/test/session.spec.d.ts.map +0 -1
  107. package/dist/test/unidirectional-streams.spec.d.ts +0 -2
  108. package/dist/test/unidirectional-streams.spec.d.ts.map +0 -1
  109. package/failslogolicensereadme.txt +0 -4
  110. package/lib/event-loop.js +0 -88
  111. package/lib/native.js +0 -28
  112. package/lib/transport.js +0 -82
  113. package/platform/icufix/fakedata.cpp +0 -8
  114. package/platform/quiche/quic/core/io/socket_win.inc +0 -3
  115. package/platform/quiche_platform_impl/quiche_bug_tracker_impl.h +0 -7
  116. package/platform/quiche_platform_impl/quiche_client_stats_impl.h +0 -7
  117. package/platform/quiche_platform_impl/quiche_command_line_flags_impl.h +0 -7
  118. package/platform/quiche_platform_impl/quiche_containers_impl.h +0 -7
  119. package/platform/quiche_platform_impl/quiche_event_loop_impl.h +0 -7
  120. package/platform/quiche_platform_impl/quiche_export_impl.h +0 -6
  121. package/platform/quiche_platform_impl/quiche_flag_utils_impl.h +0 -11
  122. package/platform/quiche_platform_impl/quiche_flags_impl.h +0 -8
  123. package/platform/quiche_platform_impl/quiche_iovec_impl.h +0 -10
  124. package/platform/quiche_platform_impl/quiche_logging_impl.h +0 -21
  125. package/platform/quiche_platform_impl/quiche_mem_slice_impl.h +0 -2
  126. package/platform/quiche_platform_impl/quiche_mutex_impl.h +0 -8
  127. package/platform/quiche_platform_impl/quiche_prefetch_impl.h +0 -11
  128. package/platform/quiche_platform_impl/quiche_reference_counted_impl.h +0 -16
  129. package/platform/quiche_platform_impl/quiche_server_stats_impl.h +0 -7
  130. package/platform/quiche_platform_impl/quiche_stack_trace_impl.h +0 -12
  131. package/platform/quiche_platform_impl/quiche_stream_buffer_allocator_impl.h +0 -8
  132. package/platform/quiche_platform_impl/quiche_testvalue_impl.h +0 -1
  133. package/platform/quiche_platform_impl/quiche_thread_local_impl.h +0 -6
  134. package/platform/quiche_platform_impl/quiche_time_utils_impl.h +0 -13
  135. package/platform/quiche_platform_impl/quiche_udp_socket_platform_impl.h +0 -39
  136. package/src/http3backendresponse.cc +0 -36
  137. package/src/http3backendresponse.h +0 -109
  138. package/src/http3client.cc +0 -1529
  139. package/src/http3client.h +0 -557
  140. package/src/http3clientsession.cc +0 -65
  141. package/src/http3clientsession.h +0 -60
  142. package/src/http3clientstream.cc +0 -52
  143. package/src/http3clientstream.h +0 -42
  144. package/src/http3dispatcher.cc +0 -62
  145. package/src/http3dispatcher.h +0 -57
  146. package/src/http3eventloop.cc +0 -1107
  147. package/src/http3eventloop.h +0 -316
  148. package/src/http3server.cc +0 -514
  149. package/src/http3server.h +0 -151
  150. package/src/http3serverbackend.cc +0 -105
  151. package/src/http3serverbackend.h +0 -98
  152. package/src/http3serversession.cc +0 -123
  153. package/src/http3serversession.h +0 -95
  154. package/src/http3serverstream.cc +0 -463
  155. package/src/http3serverstream.h +0 -114
  156. package/src/http3sessioncache.cc +0 -85
  157. package/src/http3sessioncache.h +0 -59
  158. package/src/http3wtsessionvisitor.cc +0 -46
  159. package/src/http3wtsessionvisitor.h +0 -397
  160. package/src/http3wtstreamvisitor.cc +0 -155
  161. package/src/http3wtstreamvisitor.h +0 -404
  162. package/test/event-loop.node.js +0 -24
  163. package/tsconfig.json +0 -39
@@ -12,6 +12,8 @@ import { KNOWN_BYTES, KNOWN_BYTES_LENGTH } from './fixtures/known-bytes.js'
12
12
  describe('unidirectional streams', function () {
13
13
  /** @type {import('../lib/dom').WebTransport | undefined} */
14
14
  let client
15
+ let forceReliable = false
16
+ if (process.env.USE_HTTP2 === 'true') forceReliable = true
15
17
 
16
18
  // @ts-ignore
17
19
  afterEach(async () => {
@@ -32,7 +34,9 @@ describe('unidirectional streams', function () {
32
34
  algorithm: 'sha-256',
33
35
  value: readCertHash(process.env.CERT_HASH)
34
36
  }
35
- ]
37
+ ],
38
+ // @ts-ignore
39
+ forceReliable
36
40
  }
37
41
  )
38
42
  await client.ready
@@ -47,6 +51,7 @@ describe('unidirectional streams', function () {
47
51
 
48
52
  // the remote will close the session
49
53
  const result = await client.closed
54
+ client = undefined
50
55
 
51
56
  // should receive the default close info
52
57
  expect(result).to.have.property('reason', '')
@@ -63,7 +68,9 @@ describe('unidirectional streams', function () {
63
68
  algorithm: 'sha-256',
64
69
  value: readCertHash(process.env.CERT_HASH)
65
70
  }
66
- ]
71
+ ],
72
+ // @ts-ignore
73
+ forceReliable
67
74
  }
68
75
  )
69
76
  await client.ready
@@ -77,7 +84,13 @@ describe('unidirectional streams', function () {
77
84
  })
78
85
 
79
86
  it('handles fin when paused due to backpressure', async function () {
80
- this.timeout(6000)
87
+ let addpolyfill = 0
88
+ if (
89
+ process.env.USE_POLYFILL === 'true' ||
90
+ process.env.USE_PONYFILL === 'true'
91
+ )
92
+ addpolyfill = 4000
93
+ this.timeout(6000 + addpolyfill)
81
94
  client = new WebTransport(
82
95
  `${process.env.SERVER_URL}/unidirectional_server_delay_before_read`,
83
96
  {
@@ -86,7 +99,9 @@ describe('unidirectional streams', function () {
86
99
  algorithm: 'sha-256',
87
100
  value: readCertHash(process.env.CERT_HASH)
88
101
  }
89
- ]
102
+ ],
103
+ // @ts-ignore
104
+ forceReliable
90
105
  }
91
106
  )
92
107
  await client.ready
@@ -110,6 +125,7 @@ describe('unidirectional streams', function () {
110
125
 
111
126
  // the remote will close the session cleanly if everything was ok
112
127
  await client.closed
128
+ client = undefined
113
129
 
114
130
  // should receive the default close info, not true on chromium
115
131
  // expect(result).to.have.property('reason', '')