@fails-components/webtransport 0.1.5 → 0.2.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.
Files changed (70) hide show
  1. package/CMakeLists.txt +42 -111
  2. package/build.js +4 -4
  3. package/dist/lib/dom.d.ts +6 -0
  4. package/dist/lib/dom.d.ts.map +1 -1
  5. package/dist/lib/event-loop.d.ts +8 -3
  6. package/dist/lib/event-loop.d.ts.map +1 -1
  7. package/dist/lib/server.d.ts +3 -2
  8. package/dist/lib/server.d.ts.map +1 -1
  9. package/dist/lib/session.d.ts +78 -18
  10. package/dist/lib/session.d.ts.map +1 -1
  11. package/dist/lib/stream.d.ts +13 -5
  12. package/dist/lib/stream.d.ts.map +1 -1
  13. package/dist/lib/transport.d.ts.map +1 -1
  14. package/dist/lib/types.d.ts +11 -2
  15. package/dist/lib/types.d.ts.map +1 -1
  16. package/dist/lib/webtransport.d.ts +22 -0
  17. package/dist/lib/webtransport.d.ts.map +1 -1
  18. package/dist/test/bidirectional-streams.spec.d.ts.map +1 -1
  19. package/dist/test/datagrams.spec.d.ts.map +1 -1
  20. package/dist/test/fixtures/p-timeout.d.ts +8 -0
  21. package/dist/test/fixtures/p-timeout.d.ts.map +1 -0
  22. package/dist/test/fixtures/read-stream.d.ts.map +1 -1
  23. package/dist/test/unidirectional-streams.spec.d.ts.map +1 -1
  24. package/lib/dom.ts +7 -2
  25. package/lib/event-loop.js +13 -7
  26. package/lib/server.js +1 -1
  27. package/lib/session.js +71 -21
  28. package/lib/stream.js +137 -12
  29. package/lib/transport.js +3 -1
  30. package/lib/types.ts +13 -2
  31. package/lib/webtransport.js +31 -0
  32. package/package.json +5 -4
  33. package/platform/base/strings/utf_ostream_operators.h +5 -0
  34. package/platform/quiche/quic/core/io/socket_win.inc +3 -0
  35. package/platform/quiche_platform_impl/quiche_command_line_flags_impl.h +7 -0
  36. package/platform/quiche_platform_impl/quiche_export_impl.h +3 -9
  37. package/platform/quiche_platform_impl/quiche_server_stats_impl.h +1 -22
  38. package/platform/quiche_platform_impl/quiche_stream_buffer_allocator_impl.h +1 -4
  39. package/platform/quiche_platform_impl/quiche_time_utils_impl.h +1 -13
  40. package/platform/quiche_platform_impl/quiche_udp_socket_platform_impl.h +9 -0
  41. package/readme.md +3 -1
  42. package/src/http3client.cc +13 -29
  43. package/src/http3client.h +2 -6
  44. package/src/http3clientsession.cc +51 -40
  45. package/src/http3clientsession.h +44 -31
  46. package/src/http3clientstream.cc +17 -0
  47. package/src/http3clientstream.h +10 -0
  48. package/src/http3eventloop.cc +81 -61
  49. package/src/http3eventloop.h +10 -7
  50. package/src/http3server.cc +1 -1
  51. package/src/http3serversession.cc +1 -136
  52. package/src/http3serversession.h +7 -77
  53. package/src/http3serverstream.cc +0 -49
  54. package/src/http3serverstream.h +0 -5
  55. package/src/http3wtsessionvisitor.cc +1 -1
  56. package/src/http3wtsessionvisitor.h +24 -37
  57. package/src/http3wtstreamvisitor.cc +35 -8
  58. package/src/http3wtstreamvisitor.h +81 -3
  59. package/test/bidirectional-streams.spec.js +16 -7
  60. package/test/datagrams.spec.js +31 -20
  61. package/test/fixtures/p-timeout.js +33 -0
  62. package/test/fixtures/read-stream.js +4 -1
  63. package/test/unidirectional-streams.spec.js +24 -15
  64. package/platform/net/quiche/common/platform/impl/quiche_flags_impl.h +0 -12
  65. package/platform/poll.h +0 -2
  66. package/platform/quiche/quic/core/io/quic_poll_event_loop.h +0 -8
  67. package/platform/quiche_platform_impl/quic_testvalue_impl.h +0 -19
  68. package/platform/quiche_platform_impl/quic_udp_socket_winsock.cc +0 -732
  69. package/platform/quiche_platform_impl/quiche_time_utils_impl.cc +0 -43
  70. package/platform/quiche_platform_impl/socket_winsock.cc +0 -535
package/CMakeLists.txt CHANGED
@@ -74,95 +74,9 @@ endif(COMMAND cmake_policy)
74
74
  add_compile_definitions(QUICHE_ENABLE_LIBEVENT)
75
75
 
76
76
 
77
- add_library(icu STATIC
78
- #icu
79
- third_party/icu/icu4c/source/common/appendable.cpp
80
- third_party/icu/icu4c/source/common/bytestream.cpp
81
- third_party/icu/icu4c/source/common/bytesinkutil.cpp
82
- third_party/icu/icu4c/source/common/bytestrie.cpp
83
- third_party/icu/icu4c/source/common/bmpset.cpp
84
- third_party/icu/icu4c/source/common/charstr.cpp
85
- third_party/icu/icu4c/source/common/cmemory.cpp
86
- third_party/icu/icu4c/source/common/cstring.cpp
87
- third_party/icu/icu4c/source/common/edits.cpp
88
- third_party/icu/icu4c/source/common/locavailable.cpp
89
- third_party/icu/icu4c/source/common/localebuilder.cpp
90
- third_party/icu/icu4c/source/common/locid.cpp
91
- third_party/icu/icu4c/source/common/locmap.cpp
92
- third_party/icu/icu4c/source/common/loclikely.cpp
93
- third_party/icu/icu4c/source/common/loadednormalizer2impl.cpp
94
- third_party/icu/icu4c/source/common/normalizer2.cpp
95
- third_party/icu/icu4c/source/common/normalizer2impl.cpp
96
- third_party/icu/icu4c/source/common/patternprops.cpp
97
- third_party/icu/icu4c/source/common/propname.cpp
98
- third_party/icu/icu4c/source/common/punycode.cpp
99
- third_party/icu/icu4c/source/common/resource.cpp
100
- third_party/icu/icu4c/source/common/stringpiece.cpp
101
- third_party/icu/icu4c/source/common/uarrsort.cpp
102
- third_party/icu/icu4c/source/common/ubidi_props.cpp
103
- third_party/icu/icu4c/source/common/uchar.cpp
104
- third_party/icu/icu4c/source/common/ucmndata.cpp
105
- third_party/icu/icu4c/source/common/ucln_cmn.cpp
106
- third_party/icu/icu4c/source/common/ucptrie.cpp
107
- third_party/icu/icu4c/source/common/ucol_swp.cpp
108
- third_party/icu/icu4c/source/common/udata.cpp
109
- third_party/icu/icu4c/source/common/udatamem.cpp
110
- third_party/icu/icu4c/source/common/udataswp.cpp
111
- third_party/icu/icu4c/source/common/uenum.cpp
112
- third_party/icu/icu4c/source/common/uhash.cpp
113
- third_party/icu/icu4c/source/common/uloc.cpp
114
- third_party/icu/icu4c/source/common/uloc_tag.cpp
115
- third_party/icu/icu4c/source/common/uloc_keytype.cpp
116
- third_party/icu/icu4c/source/common/umapfile.cpp
117
- third_party/icu/icu4c/source/common/umath.cpp
118
- third_party/icu/icu4c/source/common/umutablecptrie.cpp
119
- third_party/icu/icu4c/source/common/umutex.cpp
120
- third_party/icu/icu4c/source/common/unistr.cpp
121
- third_party/icu/icu4c/source/common/unifilt.cpp
122
- third_party/icu/icu4c/source/common/unifunct.cpp
123
- third_party/icu/icu4c/source/common/unisetspan.cpp
124
- third_party/icu/icu4c/source/common/ustring.cpp
125
- third_party/icu/icu4c/source/common/ustrtrns.cpp
126
- third_party/icu/icu4c/source/common/ustrenum.cpp
127
- third_party/icu/icu4c/source/common/uscript_props.cpp
128
- third_party/icu/icu4c/source/common/util.cpp
129
- third_party/icu/icu4c/source/common/uts46.cpp
130
- third_party/icu/icu4c/source/common/uobject.cpp
131
- third_party/icu/icu4c/source/common/uinvchar.cpp
132
- third_party/icu/icu4c/source/common/uresbund.cpp
133
- third_party/icu/icu4c/source/common/uresdata.cpp
134
- third_party/icu/icu4c/source/common/uniset.cpp
135
- third_party/icu/icu4c/source/common/utf_impl.cpp
136
- third_party/icu/icu4c/source/common/utrace.cpp
137
- third_party/icu/icu4c/source/common/utrie2.cpp
138
- third_party/icu/icu4c/source/common/utrie_swap.cpp
139
- third_party/icu/icu4c/source/common/utypes.cpp
140
- third_party/icu/icu4c/source/common/uvector.cpp
141
- third_party/icu/icu4c/source/common/putil.cpp
142
- )
143
- target_include_directories(icu
144
- PUBLIC third_party/icu/icu4c/source/common
145
- )
146
- if (WIN32)
147
- target_sources(icu PRIVATE
148
- third_party/icu/icu4c/source/common/wintz.cpp
149
- )
150
- target_compile_definitions(icu PRIVATE
151
- #hack since this function is not currently used
152
- ICU_DATA_DIR_WINDOWS=""
153
- )
154
- else()
155
- # fix data problem
156
- target_sources(icu PRIVATE
157
- platform/icufix/fakedata.cpp
158
- )
159
- endif()
160
-
161
- target_compile_definitions(icu
162
- PRIVATE U_DEFINE_FALSE_AND_TRUE=1
163
- U_STATIC_IMPLEMENTATION
164
- U_COMMON_IMPLEMENTATION
165
- )
77
+ IF( NOT (WIN32 OR APPLE))
78
+ find_package(ICU COMPONENTS uc i18n REQUIRED)
79
+ ENDIF(NOT (WIN32 OR APPLE))
166
80
 
167
81
  add_library(gquiche STATIC
168
82
  #plattform impl
@@ -177,8 +91,6 @@ platform/quiche_platform_impl/quiche_mutex_impl.h
177
91
  platform/quiche_platform_impl/quiche_stack_trace_impl.h
178
92
  platform/quiche_platform_impl/quiche_stream_buffer_allocator_impl.h
179
93
  platform/quiche_platform_impl/quiche_time_utils_impl.h
180
- platform/quiche_platform_impl/quiche_time_utils_impl.cc
181
- platform/quiche_platform_impl/quic_testvalue_impl.h
182
94
  platform/quiche_platform_impl/quiche_udp_socket_platform_impl.h
183
95
  platform/quiche_platform_impl/quiche_prefetch_impl.h
184
96
  platform/quiche_platform_impl/quiche_server_stats_impl.h
@@ -196,12 +108,12 @@ platform/quiche_platform_impl/quiche_flag_utils_impl.h
196
108
  third_party/googleurl/base/debug/crash_logging.cc
197
109
  third_party/googleurl/base/debug/crash_logging.h
198
110
  third_party/googleurl/base/strings/string_util_constants.cc
199
- third_party/googleurl/base/strings/string_piece.cc
200
- third_party/googleurl/base/strings/string_piece.h
201
111
  third_party/googleurl/base/strings/string_util.cc
202
112
  third_party/googleurl/base/strings/string_util.h
203
113
  third_party/googleurl/base/strings/utf_string_conversions.cc
204
114
  third_party/googleurl/base/strings/utf_string_conversions.h
115
+ #third_party/googleurl/base/strings/utf_ostream_operators.cc
116
+ #third_party/googleurl/base/strings/utf_ostream_operators.h
205
117
  third_party/googleurl/url/url_canon.cc
206
118
  third_party/googleurl/url/url_canon_internal.cc
207
119
  third_party/googleurl/url/url_canon_path.cc
@@ -232,12 +144,13 @@ third_party/googleurl/url/gurl.cc
232
144
  third_party/googleurl/url/gurl.h
233
145
  third_party/googleurl/url/third_party/mozilla/url_parse.cc
234
146
  third_party/googleurl/url/third_party/mozilla/url_parse.h
235
- third_party/googleurl/url/url_idna_icu.cc
236
147
  third_party/googleurl/base/strings/utf_string_conversion_utils.cc
237
148
  third_party/googleurl/base/strings/utf_string_conversion_utils.h
238
149
  third_party/googleurl/build/buildflag.h
239
150
  third_party/googleurl/build/build_config.h
240
151
  # normal files
152
+ third_party/quiche/quiche/common/capsule.cc
153
+ third_party/quiche/quiche/common/capsule.h
241
154
  third_party/quiche/quiche/common/platform/api/quiche_bug_tracker.h
242
155
  third_party/quiche/quiche/common/platform/api/quiche_export.h
243
156
  third_party/quiche/quiche/common/platform/api/quiche_flag_utils.h
@@ -251,19 +164,22 @@ third_party/quiche/quiche/common/platform/api/quiche_mutex.cc
251
164
  third_party/quiche/quiche/common/platform/api/quiche_mutex.h
252
165
  third_party/quiche/quiche/common/platform/api/quiche_prefetch.h
253
166
  third_party/quiche/quiche/common/platform/api/quiche_reference_counted.h
254
- third_party/quiche/quiche/common/platform/api/quiche_thread_local.h
255
167
  third_party/quiche/quiche/common/platform/api/quiche_time_utils.h
256
168
  third_party/quiche/quiche/common/platform/api/quiche_url_utils.h
169
+ third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_command_line_flags_impl.cc
170
+ third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_command_line_flags_impl.h
257
171
  third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_flag_utils_impl.h
258
172
  third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_flags_impl.h
259
173
  third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_flags_impl.cc
260
174
  third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_prefetch_impl.h
175
+ third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_logging_impl.cc
261
176
  third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_logging_impl.h
262
177
  third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_mutex_impl.cc
263
178
  third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_mutex_impl.h
264
179
  third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_stack_trace_impl.cc
265
180
  third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_stack_trace_impl.h
266
181
  third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_iovec_impl.h
182
+ third_party/quiche/quiche/common/platform/default/quiche_platform_impl/quiche_time_utils_impl.cc
267
183
  third_party/quiche/quiche/common/print_elements.h
268
184
  third_party/quiche/quiche/common/quiche_buffer_allocator.cc
269
185
  third_party/quiche/quiche/common/quiche_buffer_allocator.h
@@ -314,7 +230,6 @@ third_party/quiche/quiche/http2/adapter/window_manager.h
314
230
  third_party/quiche/quiche/http2/core/http2_trace_logging.cc
315
231
  third_party/quiche/quiche/http2/core/http2_trace_logging.h
316
232
  third_party/quiche/quiche/http2/core/priority_write_scheduler.h
317
- third_party/quiche/quiche/http2/core/write_scheduler.h
318
233
  third_party/quiche/quiche/http2/decoder/decode_buffer.cc
319
234
  third_party/quiche/quiche/http2/decoder/decode_buffer.h
320
235
  third_party/quiche/quiche/http2/decoder/decode_http2_structures.cc
@@ -588,8 +503,6 @@ third_party/quiche/quiche/quic/core/frames/quic_streams_blocked_frame.h
588
503
  third_party/quiche/quiche/quic/core/frames/quic_window_update_frame.cc
589
504
  third_party/quiche/quiche/quic/core/frames/quic_window_update_frame.h
590
505
  third_party/quiche/quiche/quic/core/handshaker_delegate_interface.h
591
- third_party/quiche/quiche/quic/core/http/capsule.cc
592
- third_party/quiche/quiche/quic/core/http/capsule.h
593
506
  third_party/quiche/quiche/quic/core/http/http_constants.cc
594
507
  third_party/quiche/quiche/quic/core/http/http_constants.h
595
508
  third_party/quiche/quiche/quic/core/http/http_decoder.cc
@@ -638,7 +551,13 @@ third_party/quiche/quiche/quic/core/http/web_transport_stream_adapter.h
638
551
  third_party/quiche/quiche/quic/core/io/quic_event_loop.h
639
552
  third_party/quiche/quiche/quic/core/io/quic_default_event_loop.cc
640
553
  third_party/quiche/quiche/quic/core/io/quic_default_event_loop.h
554
+ third_party/quiche/quiche/quic/core/io/quic_poll_event_loop.cc
555
+ third_party/quiche/quiche/quic/core/io/quic_poll_event_loop.h
641
556
  third_party/quiche/quiche/quic/core/io/socket.h
557
+ third_party/quiche/quiche/quic/core/io/socket.cc
558
+ third_party/quiche/quiche/quic/core/io/socket_posix.inc
559
+ third_party/quiche/quiche/quic/core/io/socket_win.inc
560
+ third_party/quiche/quiche/quic/core/io/socket_internal.h
642
561
  third_party/quiche/quiche/quic/core/legacy_quic_stream_id_manager.cc
643
562
  third_party/quiche/quiche/quic/core/legacy_quic_stream_id_manager.h
644
563
  third_party/quiche/quiche/quic/core/packet_number_indexed_queue.h
@@ -698,7 +617,6 @@ third_party/quiche/quiche/quic/core/quic_buffered_packet_store.cc
698
617
  third_party/quiche/quiche/quic/core/quic_buffered_packet_store.h
699
618
  third_party/quiche/quiche/quic/core/quic_chaos_protector.cc
700
619
  third_party/quiche/quiche/quic/core/quic_chaos_protector.h
701
- third_party/quiche/quiche/quic/core/quic_clock.cc
702
620
  third_party/quiche/quiche/quic/core/quic_clock.h
703
621
  third_party/quiche/quiche/quic/core/quic_coalesced_packet.cc
704
622
  third_party/quiche/quiche/quic/core/quic_coalesced_packet.h
@@ -813,6 +731,9 @@ third_party/quiche/quiche/quic/core/quic_types.cc
813
731
  third_party/quiche/quiche/quic/core/quic_types.h
814
732
  third_party/quiche/quiche/quic/core/quic_unacked_packet_map.cc
815
733
  third_party/quiche/quiche/quic/core/quic_unacked_packet_map.h
734
+ third_party/quiche/quiche/quic/core/quic_udp_socket.cc
735
+ third_party/quiche/quiche/quic/core/quic_udp_socket_win.inc
736
+ third_party/quiche/quiche/quic/core/quic_udp_socket_posix.inc
816
737
  third_party/quiche/quiche/quic/core/quic_udp_socket.h
817
738
  third_party/quiche/quiche/quic/core/quic_utils.cc
818
739
  third_party/quiche/quiche/quic/core/quic_utils.h
@@ -837,7 +758,6 @@ third_party/quiche/quiche/quic/core/uber_quic_stream_id_manager.cc
837
758
  third_party/quiche/quiche/quic/core/uber_quic_stream_id_manager.h
838
759
  third_party/quiche/quiche/quic/core/uber_received_packet_manager.cc
839
760
  third_party/quiche/quiche/quic/core/uber_received_packet_manager.h
840
- third_party/quiche/quiche/quic/core/quic_udp_socket.h
841
761
  third_party/quiche/quiche/quic/platform/api/quic_bug_tracker.h
842
762
  third_party/quiche/quiche/quic/platform/api/quic_client_stats.h
843
763
  third_party/quiche/quiche/quic/platform/api/quic_export.h
@@ -901,25 +821,28 @@ third_party/quiche/quiche/spdy/core/spdy_simple_arena.h
901
821
  third_party/quiche/quiche/spdy/core/zero_copy_output_buffer.h
902
822
  )
903
823
 
824
+ IF(APPLE OR WIN32)
825
+ target_sources(gquiche PRIVATE third_party/googleurl/url/url_idna_ascii_only.cc)
826
+ ELSE()
827
+ target_sources(gquiche PRIVATE third_party/googleurl/url/url_idna_icu.cc)
828
+ ENDIF()
829
+
904
830
  FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party/quiche PROTOMODEL_PATH)
905
831
  FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/third_party/quiche PROTOBINDING_PATH)
906
832
 
907
833
  IF (WIN32)
908
834
  target_sources(gquiche PRIVATE third_party/googleurl/base/strings/string_util_win.cc
909
- third_party/googleurl/base/strings/string_util_win.h
910
- platform/quiche_platform_impl/socket_winsock.cc
911
- platform/quiche_platform_impl/quic_udp_socket_winsock.cc)
835
+ third_party/googleurl/base/strings/string_util_win.h)
836
+
837
+ target_compile_definitions(crypto PRIVATE strdup=_strdup)
838
+ target_compile_definitions(gquiche PRIVATE _WINSOCK_DEPRECATED_NO_WARNINGS)
912
839
  ELSE(WIN32)
913
- target_sources(gquiche PRIVATE third_party/quiche/quiche/quic/core/io/socket_posix.cc
914
- third_party/quiche/quiche/quic/core/quic_udp_socket_posix.cc
915
- )
916
840
  IF(APPLE)
917
841
  ELSE(APPLE)
918
842
  target_link_libraries(gquiche -static-libgcc -static-libstdc++)
919
843
  ENDIF(APPLE)
920
844
  ENDIF(WIN32)
921
845
 
922
- target_compile_options(gquiche PRIVATE -flax-vector-conversions)
923
846
 
924
847
 
925
848
  add_custom_command(
@@ -985,11 +908,20 @@ PUBLIC ${CMAKE_CURRENT_BINARY_DIR}
985
908
  PUBLIC ${CMAKE_JS_INC}
986
909
  )
987
910
 
988
-
989
- target_include_directories(gquiche PUBLIC third_party/icu/icu4c/source/common)
911
+ target_include_directories(crypto PUBLIC
912
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/third_party/boringssl/src/include>
913
+ )
990
914
 
991
915
  target_link_libraries(gquiche
992
- absl::base
916
+ absl::core_headers
917
+ absl::log_severity
918
+ absl::flags
919
+ absl::flags_usage
920
+ absl::flags_parse
921
+ absl::absl_check
922
+ absl::absl_log
923
+ absl::log_flags
924
+ absl::log_initialize
993
925
  absl::int128
994
926
  absl::strings
995
927
  absl::str_format
@@ -1016,7 +948,6 @@ if(MSVC AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET)
1016
948
  endif()
1017
949
 
1018
950
 
1019
- target_link_libraries(gquiche icu)
1020
951
 
1021
952
 
1022
953
  # google quiche build parameters end
package/build.js CHANGED
@@ -83,8 +83,7 @@ const extractthirdparty = async () => {
83
83
  'third_party/zlib',
84
84
  'third_party/googleurl',
85
85
  'third_party/libevent',
86
- 'third_party/protobuf',
87
- 'third_party/icu'
86
+ 'third_party/protobuf'
88
87
  ]
89
88
  for (let mod in submodules) {
90
89
  const sub = submodules[mod]
@@ -255,11 +254,12 @@ if (argv.length > 2) {
255
254
  try {
256
255
  // if we do not succeed, we have to build it ourselves
257
256
  await extractthirdparty()
257
+ await execbuild(['build', ...platformargs])
258
258
  } catch (error) {
259
259
  console.error('Building binary failed: ', error)
260
+ process.exit(1)
260
261
  }
261
- }
262
- // eslint-disable-next-line no-fallthrough
262
+ } break
263
263
  case 'build':
264
264
  try {
265
265
  await execbuild(['build', ...platformargs])
package/dist/lib/dom.d.ts CHANGED
@@ -55,10 +55,15 @@ export interface WebTransportOptions {
55
55
  allowPooling?: boolean;
56
56
  requireUnreliable?: boolean;
57
57
  serverCertificateHashes?: WebTransportHash[];
58
+ congestionControl?: WebTransportCongestionControl;
58
59
  }
59
60
  export interface WebTransport {
61
+ getStats: () => Promise<WebTransportStats>;
60
62
  readonly ready: Promise<void>;
63
+ readonly reliability: WebTransportReliabilityMode;
64
+ readonly congestionControl: WebTransportCongestionControl;
61
65
  readonly closed: Promise<WebTransportCloseInfo>;
66
+ readonly draining: Promise<undefined>;
62
67
  close: (closeInfo?: WebTransportCloseInfo) => void;
63
68
  readonly datagrams: WebTransportDatagramDuplexStream;
64
69
  createBidirectionalStream: () => Promise<WebTransportBidirectionalStream>;
@@ -67,4 +72,5 @@ export interface WebTransport {
67
72
  readonly incomingUnidirectionalStreams: ReadableStream<WebTransportReceiveStream>;
68
73
  }
69
74
  export declare type WebTransportReliabilityMode = 'pending' | 'reliable-only' | 'supports-unreliable';
75
+ export declare type WebTransportCongestionControl = 'default' | 'throughput' | 'low-latency';
70
76
  //# sourceMappingURL=dom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../lib/dom.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,yBAAyB,EAAE,MAAM,CAAA;IACjC,yBAAyB,EAAE,MAAM,CAAA;IACjC,aAAa,EAAE,MAAM,CAAA;IACrB,eAAe,EAAE,MAAM,CAAA;IACvB,WAAW,EAAE,MA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QAAQ,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAC1C,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7B,QAAQ,CAAC,WAAW,EAAE,2BAA2B,CAAA;IACjD,QAAQ,CAAC,iBAAiB,EAAE,6BAA6B,CAAA;IACzD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAC/C,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IACrC,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAA;IAClD,QAAQ,CAAC,SAAS,EAAE,gCAAgC,CAAA;IAEpD,yBAAyB,EAAE,MAAM,OAAO,CAAC,+BAA+B,CAAC,CAAA;IAEzE,QAAQ,CAAC,4BAA4B,EAAE,cAAc,CAAC,+BAA+B,CAAC,CAAA;IAEtF,0BAA0B,EAAE,MAAM,OAAO,CAAC,sBAAsB,CAAC,CAAA;IAEjE,QAAQ,CAAC,6BAA6B,EAAE,cAAc,CAAC,yBAAyB,CAAC,CAAA;CAClF;AAED,oBAAY,2BAA2B,GAAG,SAAS,GAAG,eAAe,GAAG,qBAAqB,CAAA;AAC7F,oBAAY,6BAA6B,GAAG,SAAS,GAAG,YAAY,GAAG,aAAa,CAAC"}
@@ -3,14 +3,16 @@ export class Http3EventLoop {
3
3
  static globalLoop: Http3EventLoop | null;
4
4
  static callback(): void;
5
5
  /**
6
+ * @param {any} [args]
6
7
  * @returns {Http3EventLoop}
7
8
  */
8
- static createGlobalEventLoop(): Http3EventLoop;
9
+ static createGlobalEventLoop(args?: any): Http3EventLoop;
9
10
  /**
10
11
  * @param {any} object
12
+ * @param {any} args
11
13
  * @returns {Http3EventLoop}
12
14
  */
13
- static getGlobalEventLoop(object: any): Http3EventLoop;
15
+ static getGlobalEventLoop(object: any, args: any): Http3EventLoop;
14
16
  /**
15
17
  * @param {*} [args]
16
18
  */
@@ -18,7 +20,10 @@ export class Http3EventLoop {
18
20
  eventloopInt: any;
19
21
  refObjects: Set<any>;
20
22
  loopGuardian(): void;
21
- startEventLoop(): void;
23
+ /**
24
+ * @param {*} [args]
25
+ */
26
+ startEventLoop(args?: any): void;
22
27
  loopGuardianTimer: NodeJS.Timer | undefined;
23
28
  shutdownEventLoop(): void;
24
29
  refObjectsEmptyTime: number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"event-loop.d.ts","sourceRoot":"","sources":["../../lib/event-loop.js"],"names":[],"mappings":"AAKA;IACE,oCAAoC;IACpC,mBADW,cAAc,GAAG,IAAI,CACR;IA4CxB,wBAEC;IAED;;OAEG;IACH,gCAFa,cAAc,CAS1B;IAED;;;OAGG;IACH,kCAHW,GAAG,GACD,cAAc,CAQ1B;IApED;;OAEG;IACH,wBAWC;IAVC,kBAKE;IAGF,qBAA2B;IAiB7B,qBAWC;IAxBD,uBAIC;IADC,4CAA6D;IAG/D,0BAKC;IASkC,wCAA8B;CAiClE"}
1
+ {"version":3,"file":"event-loop.d.ts","sourceRoot":"","sources":["../../lib/event-loop.js"],"names":[],"mappings":"AAKA;IACE,oCAAoC;IACpC,mBADW,cAAc,GAAG,IAAI,CACR;IAgDxB,wBAEC;IAED;;;OAGG;IACH,oCAHW,GAAG,GACD,cAAc,CAS1B;IAED;;;;OAIG;IACH,kCAJW,GAAG,QACH,GAAG,GACD,cAAc,CAQ1B;IA1ED;;OAEG;IACH,wBAYC;IAXC,kBAME;IAGF,qBAA2B;IAoB7B,qBAWC;IA3BD;;OAEG;IACH,iCAIC;IADC,4CAA6D;IAG/D,0BAKC;IASkC,wCAA8B;CAmClE"}
@@ -19,8 +19,8 @@ export class Http3Server extends Http3WebTransport implements Http3ServerEventHa
19
19
  constructor(args: Http3ServerInit);
20
20
  /** @type {Record<string, ReadableStream>} */
21
21
  sessionStreams: Record<string, ReadableStream>;
22
- /** @type {Record<string, ReadableStreamController<any>>} */
23
- sessionController: Record<string, ReadableStreamController<any>>;
22
+ /** @type {Record<string, ReadableStreamDefaultController<Http3WTSession>>} */
23
+ sessionController: Record<string, ReadableStreamDefaultController<Http3WTSession>>;
24
24
  port: number | null;
25
25
  host: string | null;
26
26
  /** @type {any} */
@@ -85,4 +85,5 @@ export type ServerSessionRequestEvent = import('./types').ServerSessionRequestEv
85
85
  export type Http3ServerInit = import('./types').Http3ServerInit;
86
86
  import { Http3WebTransport } from "./transport.js";
87
87
  import { ReadableStream } from "stream/web";
88
+ import { Http3WTSession } from "./session.js";
88
89
  //# sourceMappingURL=server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../lib/server.js"],"names":[],"mappings":";AAOA;;;;;;;;GAQG;AAEH;;GAEG;AACH;IACE;;;OAGG;IACH,kBAFW,eAAe,EAuBzB;IAlBC,6CAA6C;IAC7C,gBADW,OAAO,MAAM,EAAE,cAAc,CAAC,CACjB;IAExB,4DAA4D;IAC5D,mBADW,OAAO,MAAM,EAAE,yBAAyB,GAAG,CAAC,CAAC,CAC7B;IAE3B,oBAAgB;IAChB,oBAAgB;IAGhB,kBAAkB;IAClB,gBADW,GAAG,CACY;IAE1B,4CAAqB;IACrB,wBAAgC;IAEhC,6CAAsB;IACtB,yBAAkC;IAGpC,oBAEC;IAED,mBAOC;IADC,6BAAmB;IAGrB;;OAEG;IACH,WAFa;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,CAa1E;IAED;;OAEG;IACH,6BAFW,GAAG,QAMb;IAED;;;;OAIG;IACH,oBAJW,MAAM,SACN,GAAG,GAAG,SAAS,GACb,eAAe,mBAAmB,CAAC,CAa/C;IAED;;OAEG;IACH,uBAFW,yBAAyB,QAiBnC;IAED;;OAEG;IACH,8BAFW,gCAAgC,QAa1C;IAED;OACG;IACH,sBAEC;IAED;OACG;IACH,0BAEC;IAED;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;OACG;IACH,sBAEC;IAED;;OAEG;IACH,oBAFW,iBAAiB,QAoB3B;IAED;;OAEG;IACH,qBAFW,gCAAgC,GAAG,iBAAiB,GAAG,yBAAyB,QAoB1F;CACF;kCAnMY,OAAO,SAAS,EAAE,mBAAmB;mCACrC,OAAO,SAAS,EAAE,oBAAoB;sCACtC,OAAO,SAAS,EAAE,uBAAuB;+CACzC,OAAO,SAAS,EAAE,gCAAgC;gCAClD,OAAO,SAAS,EAAE,iBAAiB;wCACnC,OAAO,SAAS,EAAE,yBAAyB;8BAC3C,OAAO,SAAS,EAAE,eAAe"}
@@ -6,12 +6,17 @@
6
6
  * @typedef {import('./types').SessionCloseEvent} SessionCloseEvent
7
7
  * @typedef {import('./types').DatagramReceivedEvent} DatagramReceivedEvent
8
8
  * @typedef {import('./types').DatagramSendEvent} DatagramSendEvent
9
+ * @typedef {import('./types').GoawayReceivedEvent} GoawayReceivedEvent
9
10
  * @typedef {import('./types').NewStreamEvent} NewStreamEvent
10
11
  *
11
12
  * @typedef {import('./dom').WebTransportCloseInfo} WebTransportCloseInfo
12
13
  * @typedef {import('./dom').WebTransportBidirectionalStream} WebTransportBidirectionalStream
13
14
  * @typedef {import('./dom').WebTransportSendStream} WebTransportSendStream
15
+ * @typedef {import('./dom').WebTransportReceiveStream} WebTransportReceiveStream
14
16
  * @typedef {import('./dom').WebTransportDatagramDuplexStream} WebTransportDatagramDuplexStream
17
+ * @typedef {import('./dom').WebTransportReliabilityMode} WebTransportReliabilityMode
18
+ * @typedef {import('./dom').WebTransportCongestionControl} WebTransportCongestionControl
19
+ * @typedef {import('./dom').WebTransportStats} WebTransportStats
15
20
  *
16
21
  * @typedef {import('./types').NativeHttp3WTSession} NativeHttp3WTSession
17
22
  *
@@ -29,9 +34,9 @@
29
34
  */
30
35
  export class Http3WTSession implements WebTransportSessionEventHandler, WebTransportSession {
31
36
  /**
32
- * @param {SessionReadyEvent | SessionCloseEvent | DatagramReceivedEvent | DatagramSendEvent | NewStreamEvent} args
37
+ * @param {SessionReadyEvent | SessionCloseEvent | DatagramReceivedEvent | DatagramSendEvent | GoawayReceivedEvent | NewStreamEvent} args
33
38
  */
34
- static callback(args: SessionReadyEvent | SessionCloseEvent | DatagramReceivedEvent | DatagramSendEvent | NewStreamEvent): void;
39
+ static callback(args: SessionReadyEvent | SessionCloseEvent | DatagramReceivedEvent | DatagramSendEvent | GoawayReceivedEvent | NewStreamEvent): void;
35
40
  /**
36
41
  * @param {object} args
37
42
  * @param {import('./types').NativeHttp3WTSession} [args.object]
@@ -56,14 +61,24 @@ export class Http3WTSession implements WebTransportSessionEventHandler, WebTrans
56
61
  /** @type {Promise<void>} */
57
62
  ready: Promise<void>;
58
63
  readyReject: (reason?: any) => void;
64
+ /** @type {WebTransportReliabilityMode} */
65
+ reliability: WebTransportReliabilityMode;
66
+ /** @type {WebTransportCongestionControl} */
67
+ congestionControl: WebTransportCongestionControl;
59
68
  /** @type {Promise<WebTransportCloseInfo>} */
60
69
  closed: Promise<WebTransportCloseInfo>;
61
70
  closedResolve: (value: import("./dom").WebTransportCloseInfo | PromiseLike<import("./dom").WebTransportCloseInfo>) => void;
62
71
  closedReject: (reason?: any) => void;
63
- incomingBidirectionalStreams: ReadableStream<any>;
64
- incomBiDiController: import("stream/web").ReadableStreamController<any>;
65
- incomingUnidirectionalStreams: ReadableStream<any>;
66
- incomUniDiController: import("stream/web").ReadableStreamController<any>;
72
+ /** @type {Promise<undefined>} */
73
+ draining: Promise<undefined>;
74
+ drainingResolve: (value: PromiseLike<undefined> | undefined) => void;
75
+ drainingReject: (reason?: any) => void;
76
+ /** @type {ReadableStream<WebTransportBidirectionalStream>} */
77
+ incomingBidirectionalStreams: ReadableStream<WebTransportBidirectionalStream>;
78
+ incomBiDiController: ReadableStreamDefaultController<import("./dom").WebTransportBidirectionalStream>;
79
+ /** @type {ReadableStream<WebTransportReceiveStream>} */
80
+ incomingUnidirectionalStreams: ReadableStream<WebTransportReceiveStream>;
81
+ incomUniDiController: ReadableStreamDefaultController<import("./dom").WebTransportReceiveStream>;
67
82
  /** @type {Array<() => void>} */
68
83
  writeDatagramRes: (() => void)[];
69
84
  /** @type {Array<() => void>} */
@@ -72,7 +87,7 @@ export class Http3WTSession implements WebTransportSessionEventHandler, WebTrans
72
87
  writeDatagramProm: Array<Promise<void>>;
73
88
  /** @type {WebTransportDatagramDuplexStream} */
74
89
  datagrams: WebTransportDatagramDuplexStream;
75
- incomDatagramController: import("stream/web").ReadableStreamController<Uint8Array>;
90
+ incomDatagramController: ReadableStreamDefaultController<Uint8Array>;
76
91
  outgoDatagramController: import("stream/web").WritableStreamDefaultController;
77
92
  /** @type {Array<(stream: WebTransportBidirectionalStream) => void>} */
78
93
  resolveBiDi: ((stream: WebTransportBidirectionalStream) => void)[];
@@ -82,8 +97,10 @@ export class Http3WTSession implements WebTransportSessionEventHandler, WebTrans
82
97
  rejectBiDi: ((err?: Error) => void)[];
83
98
  /** @type {Array<(err?: Error) => void>} */
84
99
  rejectUniDi: ((err?: Error) => void)[];
85
- sendStreams: Set<any>;
86
- receiveStreams: Set<any>;
100
+ /** @type {Set<WebTransportSendStream>} */
101
+ sendStreams: Set<WebTransportSendStream>;
102
+ /** @type {Set<WebTransportReceiveStream>} */
103
+ receiveStreams: Set<WebTransportReceiveStream>;
87
104
  /** @type {Set<Http3WTStream>} */
88
105
  streamObjs: Set<Http3WTStream>;
89
106
  /** @type {Set<WritableStreamDefaultController>} */
@@ -94,7 +111,27 @@ export class Http3WTSession implements WebTransportSessionEventHandler, WebTrans
94
111
  * @param {NativeHttp3WTSession} object
95
112
  */
96
113
  setSessionObj(object: NativeHttp3WTSession): void;
114
+ getStats(): Promise<{
115
+ timestamp: number;
116
+ bytesSent: bigint;
117
+ packetsSent: bigint;
118
+ packetsLost: bigint;
119
+ numOutgoingStreamsCreated: number;
120
+ numIncomingStreamsCreated: number;
121
+ bytesReceived: bigint;
122
+ packetsReceived: bigint;
123
+ smoothedRtt: number;
124
+ rttVariation: number;
125
+ minRtt: number;
126
+ datagrams: {
127
+ timestamp: number;
128
+ expiredOutgoing: bigint;
129
+ droppedIncoming: bigint;
130
+ lostOutgoing: bigint;
131
+ };
132
+ }>;
97
133
  waitForDatagramsSend(): Promise<void>;
134
+ notifySessionDraining(): void;
98
135
  /**
99
136
  * @param {Http3WTStream} stream
100
137
  */
@@ -104,25 +141,25 @@ export class Http3WTSession implements WebTransportSessionEventHandler, WebTrans
104
141
  */
105
142
  removeStreamObj(stream: Http3WTStream): void;
106
143
  /**
107
- * @param {WritableStream} stream
144
+ * @param {WebTransportSendStream} stream
108
145
  * @param {WritableStreamDefaultController} controller
109
146
  */
110
- addSendStream(stream: WritableStream, controller: WritableStreamDefaultController): void;
147
+ addSendStream(stream: WebTransportSendStream, controller: WritableStreamDefaultController): void;
111
148
  /**
112
- * @param {WritableStream} stream
149
+ * @param {WebTransportSendStream} stream
113
150
  * @param {WritableStreamDefaultController} controller
114
151
  */
115
- removeSendStream(stream: WritableStream, controller: WritableStreamDefaultController): void;
152
+ removeSendStream(stream: WebTransportSendStream, controller: WritableStreamDefaultController): void;
116
153
  /**
117
- * @param {ReadableStream} stream
154
+ * @param {WebTransportReceiveStream } stream
118
155
  * @param {ReadableStreamDefaultController} controller
119
156
  */
120
- addReceiveStream(stream: ReadableStream, controller: ReadableStreamDefaultController): void;
157
+ addReceiveStream(stream: WebTransportReceiveStream, controller: ReadableStreamDefaultController): void;
121
158
  /**
122
- * @param {ReadableStream} stream
159
+ * @param {WebTransportReceiveStream } stream
123
160
  * @param {ReadableStreamDefaultController} controller
124
161
  */
125
- removeReceiveStream(stream: ReadableStream, controller: ReadableStreamDefaultController): void;
162
+ removeReceiveStream(stream: WebTransportReceiveStream, controller: ReadableStreamDefaultController): void;
126
163
  /**
127
164
  * @returns {Promise<WebTransportBidirectionalStream>}
128
165
  */
@@ -158,6 +195,10 @@ export class Http3WTSession implements WebTransportSessionEventHandler, WebTrans
158
195
  * @param {DatagramSendEvent} args
159
196
  */
160
197
  onDatagramSend(args: DatagramSendEvent): void;
198
+ /**
199
+ * @param {GoawayReceivedEvent} args
200
+ */
201
+ onGoAwayReceived(args: GoawayReceivedEvent): void;
161
202
  }
162
203
  /**
163
204
  * WebTransport session events
@@ -179,6 +220,10 @@ export type DatagramReceivedEvent = import('./types').DatagramReceivedEvent;
179
220
  * WebTransport session events
180
221
  */
181
222
  export type DatagramSendEvent = import('./types').DatagramSendEvent;
223
+ /**
224
+ * WebTransport session events
225
+ */
226
+ export type GoawayReceivedEvent = import('./types').GoawayReceivedEvent;
182
227
  /**
183
228
  * WebTransport session events
184
229
  */
@@ -195,10 +240,26 @@ export type WebTransportBidirectionalStream = import('./dom').WebTransportBidire
195
240
  * WebTransport session events
196
241
  */
197
242
  export type WebTransportSendStream = import('./dom').WebTransportSendStream;
243
+ /**
244
+ * WebTransport session events
245
+ */
246
+ export type WebTransportReceiveStream = import('./dom').WebTransportReceiveStream;
198
247
  /**
199
248
  * WebTransport session events
200
249
  */
201
250
  export type WebTransportDatagramDuplexStream = import('./dom').WebTransportDatagramDuplexStream;
251
+ /**
252
+ * WebTransport session events
253
+ */
254
+ export type WebTransportReliabilityMode = import('./dom').WebTransportReliabilityMode;
255
+ /**
256
+ * WebTransport session events
257
+ */
258
+ export type WebTransportCongestionControl = import('./dom').WebTransportCongestionControl;
259
+ /**
260
+ * WebTransport session events
261
+ */
262
+ export type WebTransportStats = import('./dom').WebTransportStats;
202
263
  /**
203
264
  * Public API
204
265
  */
@@ -221,5 +282,4 @@ export type Http3Client = import('./client').Http3Client;
221
282
  export type WritableStreamDefaultController = import('stream/web').WritableStreamDefaultController;
222
283
  import { ReadableStream } from "stream/web";
223
284
  import { Http3WTStream } from "./stream.js";
224
- import { WritableStream } from "stream/web";
225
285
  //# sourceMappingURL=session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../lib/session.js"],"names":[],"mappings":";AAGA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;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