@fails-components/webtransport 0.3.1 → 1.0.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.
- package/lib/client.js +81 -40
- package/lib/dom.ts +7 -5
- package/lib/http2/browser/browser.js +168 -0
- package/lib/http2/browser/browserparser.js +248 -0
- package/lib/http2/flowcontroller.js +371 -0
- package/lib/http2/node/capsuleparser.js +291 -0
- package/lib/http2/node/client.js +239 -0
- package/lib/http2/node/index.js +2 -0
- package/lib/http2/node/server.js +499 -0
- package/lib/http2/node/websocketparser.js +829 -0
- package/lib/http2/parserbase.js +139 -0
- package/lib/http2/parserbasehttp2.js +128 -0
- package/lib/http2/session.js +225 -0
- package/lib/http2/stream.js +354 -0
- package/lib/http2/websocketcommon.js +1 -0
- package/lib/{index.js → index.browser.js} +6 -10
- package/lib/index.node.js +27 -0
- package/lib/server.js +252 -69
- package/lib/session.js +31 -68
- package/lib/stream.js +103 -179
- package/lib/types.ts +174 -87
- package/lib/utils.js +2 -1
- package/lib/webstreams.browser.js +6 -0
- package/lib/webstreams.js +7 -0
- package/lib/webtransport.browser.js +284 -0
- package/lib/webtransport.node.js +137 -0
- package/lib/{webtransport.js → webtransportbase.js} +47 -41
- package/old_test/test.js +31 -29
- package/old_test/testsuite.js +1 -1
- package/package.json +18 -17
- package/readme.md +94 -30
- package/test/bidirectional-streams.spec.js +51 -9
- package/test/datagrams.spec.js +8 -2
- package/test/fixtures/known-bytes.js +29 -0
- package/test/fixtures/read-stream.js +1 -1
- package/test/fixtures/reader-value.js +1 -1
- package/test/fixtures/server.js +24 -10
- package/test/fixtures/webtransport.browser.js +20 -2
- package/test/fixtures/webtransport.js +1 -1
- package/test/index.js +33 -6
- package/test/pw-no-https-errors.json +5 -0
- package/test/session.spec.js +71 -52
- package/test/unidirectional-streams.spec.js +20 -4
- package/CMakeLists.txt +0 -991
- package/LICENSE.chromium +0 -27
- package/LICENSE.envoy +0 -207
- package/build.js +0 -313
- package/dist/lib/client.d.ts +0 -78
- package/dist/lib/client.d.ts.map +0 -1
- package/dist/lib/dom.d.ts +0 -87
- package/dist/lib/dom.d.ts.map +0 -1
- package/dist/lib/error.d.ts +0 -8
- package/dist/lib/error.d.ts.map +0 -1
- package/dist/lib/event-loop.d.ts +0 -33
- package/dist/lib/event-loop.d.ts.map +0 -1
- package/dist/lib/index.d.ts +0 -79
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/native.d.ts +0 -2
- package/dist/lib/native.d.ts.map +0 -1
- package/dist/lib/server.d.ts +0 -92
- package/dist/lib/server.d.ts.map +0 -1
- package/dist/lib/session.d.ts +0 -298
- package/dist/lib/session.d.ts.map +0 -1
- package/dist/lib/stream.d.ts +0 -135
- package/dist/lib/stream.d.ts.map +0 -1
- package/dist/lib/transport.d.ts +0 -34
- package/dist/lib/transport.d.ts.map +0 -1
- package/dist/lib/types.d.ts +0 -212
- package/dist/lib/types.d.ts.map +0 -1
- package/dist/lib/utils.d.ts +0 -11
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/webtransport.d.ts +0 -47
- package/dist/lib/webtransport.d.ts.map +0 -1
- package/dist/test/bidirectional-streams.spec.d.ts +0 -5
- package/dist/test/bidirectional-streams.spec.d.ts.map +0 -1
- package/dist/test/datagrams.spec.d.ts +0 -5
- package/dist/test/datagrams.spec.d.ts.map +0 -1
- package/dist/test/event-loop.node.d.ts +0 -2
- package/dist/test/event-loop.node.d.ts.map +0 -1
- package/dist/test/fixtures/certificate.d.ts +0 -21
- package/dist/test/fixtures/certificate.d.ts.map +0 -1
- package/dist/test/fixtures/chai.d.ts +0 -2
- package/dist/test/fixtures/chai.d.ts.map +0 -1
- package/dist/test/fixtures/known-bytes.d.ts +0 -6
- package/dist/test/fixtures/known-bytes.d.ts.map +0 -1
- package/dist/test/fixtures/p-timeout.d.ts +0 -8
- package/dist/test/fixtures/p-timeout.d.ts.map +0 -1
- package/dist/test/fixtures/read-cert-hash.d.ts +0 -6
- package/dist/test/fixtures/read-cert-hash.d.ts.map +0 -1
- package/dist/test/fixtures/read-stream.d.ts +0 -19
- package/dist/test/fixtures/read-stream.d.ts.map +0 -1
- package/dist/test/fixtures/reader-value.d.ts +0 -22
- package/dist/test/fixtures/reader-value.d.ts.map +0 -1
- package/dist/test/fixtures/server.d.ts +0 -5
- package/dist/test/fixtures/server.d.ts.map +0 -1
- package/dist/test/fixtures/webtransport.browser.d.ts +0 -3
- package/dist/test/fixtures/webtransport.browser.d.ts.map +0 -1
- package/dist/test/fixtures/webtransport.d.ts +0 -3
- package/dist/test/fixtures/webtransport.d.ts.map +0 -1
- package/dist/test/fixtures/write-stream.d.ts +0 -10
- package/dist/test/fixtures/write-stream.d.ts.map +0 -1
- package/dist/test/index.d.ts +0 -2
- package/dist/test/index.d.ts.map +0 -1
- package/dist/test/session.spec.d.ts +0 -5
- package/dist/test/session.spec.d.ts.map +0 -1
- package/dist/test/unidirectional-streams.spec.d.ts +0 -2
- package/dist/test/unidirectional-streams.spec.d.ts.map +0 -1
- package/failslogolicensereadme.txt +0 -4
- package/lib/event-loop.js +0 -88
- package/lib/native.js +0 -28
- package/lib/transport.js +0 -82
- package/platform/icufix/fakedata.cpp +0 -8
- package/platform/quiche/quic/core/io/socket_win.inc +0 -3
- package/platform/quiche_platform_impl/quiche_bug_tracker_impl.h +0 -7
- package/platform/quiche_platform_impl/quiche_client_stats_impl.h +0 -7
- package/platform/quiche_platform_impl/quiche_command_line_flags_impl.h +0 -7
- package/platform/quiche_platform_impl/quiche_containers_impl.h +0 -7
- package/platform/quiche_platform_impl/quiche_event_loop_impl.h +0 -7
- package/platform/quiche_platform_impl/quiche_export_impl.h +0 -6
- package/platform/quiche_platform_impl/quiche_flag_utils_impl.h +0 -11
- package/platform/quiche_platform_impl/quiche_flags_impl.h +0 -8
- package/platform/quiche_platform_impl/quiche_iovec_impl.h +0 -10
- package/platform/quiche_platform_impl/quiche_logging_impl.h +0 -21
- package/platform/quiche_platform_impl/quiche_mem_slice_impl.h +0 -2
- package/platform/quiche_platform_impl/quiche_mutex_impl.h +0 -8
- package/platform/quiche_platform_impl/quiche_prefetch_impl.h +0 -11
- package/platform/quiche_platform_impl/quiche_reference_counted_impl.h +0 -16
- package/platform/quiche_platform_impl/quiche_server_stats_impl.h +0 -7
- package/platform/quiche_platform_impl/quiche_stack_trace_impl.h +0 -12
- package/platform/quiche_platform_impl/quiche_stream_buffer_allocator_impl.h +0 -8
- package/platform/quiche_platform_impl/quiche_testvalue_impl.h +0 -1
- package/platform/quiche_platform_impl/quiche_thread_local_impl.h +0 -6
- package/platform/quiche_platform_impl/quiche_time_utils_impl.h +0 -13
- package/platform/quiche_platform_impl/quiche_udp_socket_platform_impl.h +0 -39
- package/src/http3backendresponse.cc +0 -36
- package/src/http3backendresponse.h +0 -109
- package/src/http3client.cc +0 -1529
- package/src/http3client.h +0 -557
- package/src/http3clientsession.cc +0 -65
- package/src/http3clientsession.h +0 -60
- package/src/http3clientstream.cc +0 -52
- package/src/http3clientstream.h +0 -42
- package/src/http3dispatcher.cc +0 -62
- package/src/http3dispatcher.h +0 -57
- package/src/http3eventloop.cc +0 -1107
- package/src/http3eventloop.h +0 -316
- package/src/http3server.cc +0 -514
- package/src/http3server.h +0 -151
- package/src/http3serverbackend.cc +0 -105
- package/src/http3serverbackend.h +0 -98
- package/src/http3serversession.cc +0 -123
- package/src/http3serversession.h +0 -95
- package/src/http3serverstream.cc +0 -463
- package/src/http3serverstream.h +0 -114
- package/src/http3sessioncache.cc +0 -85
- package/src/http3sessioncache.h +0 -59
- package/src/http3wtsessionvisitor.cc +0 -46
- package/src/http3wtsessionvisitor.h +0 -397
- package/src/http3wtstreamvisitor.cc +0 -155
- package/src/http3wtstreamvisitor.h +0 -404
- package/test/event-loop.node.js +0 -24
- package/tsconfig.json +0 -39
package/src/http3clientstream.cc
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// modifications
|
|
2
|
-
// Copyright (c) 2022 Marten Richter or other contributers (see commit). All rights reserved.
|
|
3
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
// found in the LICENSE file.
|
|
5
|
-
|
|
6
|
-
// original copyright, see LICENSE.chromium
|
|
7
|
-
// Copyright (c) 2018 The Chromium Authors. All rights reserved.
|
|
8
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
9
|
-
// found in the LICENSE file.
|
|
10
|
-
|
|
11
|
-
#include "src/http3clientstream.h"
|
|
12
|
-
#include "quiche/common/platform/api/quiche_logging.h"
|
|
13
|
-
|
|
14
|
-
namespace quic {
|
|
15
|
-
|
|
16
|
-
void Http3ClientStream::OnBodyAvailable() {
|
|
17
|
-
if (!drop_response_body_) {
|
|
18
|
-
QuicSpdyClientStream::OnBodyAvailable();
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
while (HasBytesToRead()) {
|
|
23
|
-
struct iovec iov;
|
|
24
|
-
if (GetReadableRegions(&iov, 1) == 0) {
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
MarkConsumed(iov.iov_len);
|
|
28
|
-
}
|
|
29
|
-
if (sequencer()->IsClosed()) {
|
|
30
|
-
OnFinRead();
|
|
31
|
-
} else {
|
|
32
|
-
sequencer()->SetUnblocked();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
bool Http3ClientStream::ParseAndValidateStatusCode() {
|
|
37
|
-
const size_t num_previous_interim_headers = preliminary_headers().size();
|
|
38
|
-
if (!QuicSpdyClientStream::ParseAndValidateStatusCode()) {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
// The base ParseAndValidateStatusCode() may have added a preliminary header.
|
|
42
|
-
if (preliminary_headers().size() > num_previous_interim_headers) {
|
|
43
|
-
QUICHE_DCHECK_EQ(preliminary_headers().size(),
|
|
44
|
-
num_previous_interim_headers + 1);
|
|
45
|
-
if (on_interim_headers_) {
|
|
46
|
-
on_interim_headers_(preliminary_headers().back());
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
} // namespace quic
|
package/src/http3clientstream.h
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// modifications
|
|
2
|
-
// Copyright (c) 2022 Marten Richter or other contributers (see commit). All rights reserved.
|
|
3
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
// found in the LICENSE file.
|
|
5
|
-
|
|
6
|
-
// original copyright, see LICENSE.chromium
|
|
7
|
-
// Copyright (c) 2018 The Chromium Authors. All rights reserved.
|
|
8
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
9
|
-
// found in the LICENSE file.
|
|
10
|
-
|
|
11
|
-
#ifndef HTTP3_CLIENT_STREAM_H
|
|
12
|
-
#define HTTP3_CLIENT_STREAM_H
|
|
13
|
-
|
|
14
|
-
#include "quiche/quic/core/http/quic_spdy_client_stream.h"
|
|
15
|
-
|
|
16
|
-
namespace quic {
|
|
17
|
-
|
|
18
|
-
class Http3ClientStream : public QuicSpdyClientStream {
|
|
19
|
-
public:
|
|
20
|
-
Http3ClientStream(QuicStreamId id, QuicSpdyClientSession* session,
|
|
21
|
-
StreamType type, bool drop_response_body)
|
|
22
|
-
: QuicSpdyClientStream(id, session, type),
|
|
23
|
-
drop_response_body_(drop_response_body) {}
|
|
24
|
-
void OnBodyAvailable() override;
|
|
25
|
-
|
|
26
|
-
void set_on_interim_headers(
|
|
27
|
-
std::function<void(const spdy::Http2HeaderBlock&)> on_interim_headers) {
|
|
28
|
-
on_interim_headers_ = std::move(on_interim_headers);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
protected:
|
|
32
|
-
bool ParseAndValidateStatusCode() override;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
private:
|
|
36
|
-
std::function<void(const spdy::Http2HeaderBlock&)> on_interim_headers_;
|
|
37
|
-
const bool drop_response_body_;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
} // namespace quic
|
|
41
|
-
|
|
42
|
-
#endif // QUICHE_QUIC_TOOLS_QUIC_SIMPLE_CLIENT_STREAM_H_
|
package/src/http3dispatcher.cc
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// modifications
|
|
2
|
-
// Copyright (c) 2022 Marten Richter or other contributers (see commit). All rights reserved.
|
|
3
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
// found in the LICENSE file.
|
|
5
|
-
|
|
6
|
-
// original copyright, see LICENSE.chromium
|
|
7
|
-
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
8
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
9
|
-
// found in the LICENSE file.
|
|
10
|
-
|
|
11
|
-
#include "src/http3dispatcher.h"
|
|
12
|
-
#include "src/http3serversession.h"
|
|
13
|
-
|
|
14
|
-
#include "absl/strings/string_view.h"
|
|
15
|
-
|
|
16
|
-
namespace quic {
|
|
17
|
-
|
|
18
|
-
Http3Dispatcher::Http3Dispatcher(
|
|
19
|
-
const QuicConfig* config,
|
|
20
|
-
const QuicCryptoServerConfig* crypto_config,
|
|
21
|
-
QuicVersionManager* version_manager,
|
|
22
|
-
std::unique_ptr<QuicConnectionHelperInterface> helper,
|
|
23
|
-
std::unique_ptr<QuicCryptoServerStreamBase::Helper> session_helper,
|
|
24
|
-
std::unique_ptr<QuicAlarmFactory> alarm_factory,
|
|
25
|
-
Http3ServerBackend* http3_server_backend,
|
|
26
|
-
uint8_t expected_server_connection_id_length,
|
|
27
|
-
ConnectionIdGeneratorInterface& generator)
|
|
28
|
-
: QuicDispatcher(config,
|
|
29
|
-
crypto_config,
|
|
30
|
-
version_manager,
|
|
31
|
-
std::move(helper),
|
|
32
|
-
std::move(session_helper),
|
|
33
|
-
std::move(alarm_factory),
|
|
34
|
-
expected_server_connection_id_length,
|
|
35
|
-
generator),
|
|
36
|
-
http3_server_backend_(http3_server_backend) {}
|
|
37
|
-
|
|
38
|
-
Http3Dispatcher::~Http3Dispatcher() = default;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
std::unique_ptr<QuicSession> Http3Dispatcher::CreateQuicSession(
|
|
43
|
-
QuicConnectionId connection_id, const QuicSocketAddress& self_address,
|
|
44
|
-
const QuicSocketAddress& peer_address, absl::string_view /*alpn*/,
|
|
45
|
-
const ParsedQuicVersion& version,
|
|
46
|
-
const ParsedClientHello& /*parsed_chlo*/,
|
|
47
|
-
ConnectionIdGeneratorInterface& connection_id_generator) {
|
|
48
|
-
// The QuicServerSessionBase takes ownership of |connection| below.
|
|
49
|
-
QuicConnection* connection =
|
|
50
|
-
new QuicConnection(connection_id, self_address, peer_address, helper(),
|
|
51
|
-
alarm_factory(), writer(),
|
|
52
|
-
/* owns_writer= */ false, Perspective::IS_SERVER,
|
|
53
|
-
ParsedQuicVersionVector{version}, connection_id_generator);
|
|
54
|
-
|
|
55
|
-
auto session = std::make_unique<Http3ServerSession>(
|
|
56
|
-
config(), GetSupportedVersions(), connection, this, session_helper(),
|
|
57
|
-
crypto_config(), compressed_certs_cache(), http3_server_backend_);
|
|
58
|
-
session->Initialize();
|
|
59
|
-
return session;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
} // namespace quic
|
package/src/http3dispatcher.h
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// modifications
|
|
2
|
-
// Copyright (c) 2022 Marten Richter or other contributers (see commit). All rights reserved.
|
|
3
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
// found in the LICENSE file.
|
|
5
|
-
|
|
6
|
-
// original copyright, see LICENSE.chromium
|
|
7
|
-
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
8
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
9
|
-
// found in the LICENSE file.
|
|
10
|
-
|
|
11
|
-
#ifndef HTTP3_DISPATCHER
|
|
12
|
-
#define HTTP3_DISPATCHER
|
|
13
|
-
|
|
14
|
-
#include "src/http3serverbackend.h"
|
|
15
|
-
#include "absl/strings/string_view.h"
|
|
16
|
-
#include "quiche/quic/core/http/quic_server_session_base.h"
|
|
17
|
-
#include "quiche/quic/core/quic_dispatcher.h"
|
|
18
|
-
|
|
19
|
-
namespace quic
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
class Http3Dispatcher : public QuicDispatcher
|
|
23
|
-
{
|
|
24
|
-
public:
|
|
25
|
-
Http3Dispatcher(
|
|
26
|
-
const QuicConfig *config,
|
|
27
|
-
const QuicCryptoServerConfig *crypto_config,
|
|
28
|
-
QuicVersionManager *version_manager,
|
|
29
|
-
std::unique_ptr<QuicConnectionHelperInterface> helper,
|
|
30
|
-
std::unique_ptr<QuicCryptoServerStreamBase::Helper> session_helper,
|
|
31
|
-
std::unique_ptr<QuicAlarmFactory> alarm_factory,
|
|
32
|
-
Http3ServerBackend *http3_server_backend,
|
|
33
|
-
uint8_t expected_server_connection_id_length,
|
|
34
|
-
ConnectionIdGeneratorInterface& generator);
|
|
35
|
-
|
|
36
|
-
~Http3Dispatcher() override;
|
|
37
|
-
|
|
38
|
-
protected:
|
|
39
|
-
std::unique_ptr<QuicSession> CreateQuicSession(
|
|
40
|
-
QuicConnectionId connection_id, const QuicSocketAddress &self_address,
|
|
41
|
-
const QuicSocketAddress &peer_address, absl::string_view alpn,
|
|
42
|
-
const ParsedQuicVersion &version,
|
|
43
|
-
const ParsedClientHello &parsed_chlo,
|
|
44
|
-
ConnectionIdGeneratorInterface& connection_id_generator) override;
|
|
45
|
-
|
|
46
|
-
Http3ServerBackend *server_backend()
|
|
47
|
-
{
|
|
48
|
-
return http3_server_backend_;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
private:
|
|
52
|
-
Http3ServerBackend *http3_server_backend_; // Unowned.
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
} // namespace quic
|
|
56
|
-
|
|
57
|
-
#endif
|