@encharm/cws 4.5.1 → 4.5.2
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/binding.gyp +1 -1
- package/dist/bindings/cws_darwin_arm64_node137.node +0 -0
- package/dist/bindings/cws_linux_x64_node137.node +0 -0
- package/package.json +1 -1
- package/src/Addon.h +6 -1
- package/src/headers/24/acorn_version.h +6 -0
- package/src/headers/24/addon_permission.h +31 -0
- package/src/headers/24/agent.h +195 -0
- package/src/headers/24/aliased_buffer-inl.h +244 -0
- package/src/headers/24/aliased_buffer.h +206 -0
- package/src/headers/24/aliased_struct-inl.h +54 -0
- package/src/headers/24/aliased_struct.h +63 -0
- package/src/headers/24/amaro_version.h +6 -0
- package/src/headers/24/application.h +165 -0
- package/src/headers/24/async_context_frame.h +33 -0
- package/src/headers/24/async_wrap-inl.h +96 -0
- package/src/headers/24/async_wrap.h +244 -0
- package/src/headers/24/base_object-inl.h +330 -0
- package/src/headers/24/base_object.h +338 -0
- package/src/headers/24/base_object_types.h +74 -0
- package/src/headers/24/bindingdata.h +272 -0
- package/src/headers/24/blob_serializer_deserializer-inl.h +385 -0
- package/src/headers/24/blob_serializer_deserializer.h +132 -0
- package/src/headers/24/callback_queue-inl.h +97 -0
- package/src/headers/24/callback_queue.h +79 -0
- package/src/headers/24/cares_wrap.h +447 -0
- package/src/headers/24/child_process_permission.h +31 -0
- package/src/headers/24/cid.h +127 -0
- package/src/headers/24/cjs_module_lexer_version.h +6 -0
- package/src/headers/24/cleanup_queue-inl.h +36 -0
- package/src/headers/24/cleanup_queue.h +79 -0
- package/src/headers/24/compile_cache.h +113 -0
- package/src/headers/24/connect_wrap.h +26 -0
- package/src/headers/24/connection_wrap.h +30 -0
- package/src/headers/24/cppgc_helpers-inl.h +65 -0
- package/src/headers/24/cppgc_helpers.h +162 -0
- package/src/headers/24/crypto/crypto_aes.h +97 -0
- package/src/headers/24/crypto/crypto_argon2.h +86 -0
- package/src/headers/24/crypto/crypto_bio.h +193 -0
- package/src/headers/24/crypto/crypto_chacha20_poly1305.h +64 -0
- package/src/headers/24/crypto/crypto_cipher.h +281 -0
- package/src/headers/24/crypto/crypto_clienthello-inl.h +90 -0
- package/src/headers/24/crypto/crypto_clienthello.h +131 -0
- package/src/headers/24/crypto/crypto_common.h +48 -0
- package/src/headers/24/crypto/crypto_context.h +171 -0
- package/src/headers/24/crypto/crypto_dh.h +126 -0
- package/src/headers/24/crypto/crypto_dsa.h +50 -0
- package/src/headers/24/crypto/crypto_ec.h +163 -0
- package/src/headers/24/crypto/crypto_hash.h +89 -0
- package/src/headers/24/crypto/crypto_hkdf.h +61 -0
- package/src/headers/24/crypto/crypto_hmac.h +92 -0
- package/src/headers/24/crypto/crypto_kem.h +113 -0
- package/src/headers/24/crypto/crypto_keygen.h +290 -0
- package/src/headers/24/crypto/crypto_keys.h +392 -0
- package/src/headers/24/crypto/crypto_ml_dsa.h +21 -0
- package/src/headers/24/crypto/crypto_pbkdf2.h +74 -0
- package/src/headers/24/crypto/crypto_random.h +124 -0
- package/src/headers/24/crypto/crypto_rsa.h +136 -0
- package/src/headers/24/crypto/crypto_scrypt.h +85 -0
- package/src/headers/24/crypto/crypto_sig.h +156 -0
- package/src/headers/24/crypto/crypto_spkac.h +21 -0
- package/src/headers/24/crypto/crypto_timing.h +20 -0
- package/src/headers/24/crypto/crypto_tls.h +309 -0
- package/src/headers/24/crypto/crypto_util.h +598 -0
- package/src/headers/24/crypto/crypto_x509.h +140 -0
- package/src/headers/24/data.h +148 -0
- package/src/headers/24/debug_utils-inl.h +232 -0
- package/src/headers/24/debug_utils.h +193 -0
- package/src/headers/24/defs.h +254 -0
- package/src/headers/24/diagnosticfilename-inl.h +33 -0
- package/src/headers/24/embedded_data.h +17 -0
- package/src/headers/24/encoding_binding.h +60 -0
- package/src/headers/24/endpoint.h +421 -0
- package/src/headers/24/env-inl.h +935 -0
- package/src/headers/24/env.h +1257 -0
- package/src/headers/24/env_properties.h +561 -0
- package/src/headers/24/fs_permission.h +167 -0
- package/src/headers/24/handle_wrap.h +123 -0
- package/src/headers/24/histogram-inl.h +107 -0
- package/src/headers/24/histogram.h +279 -0
- package/src/headers/24/http3.h +44 -0
- package/src/headers/24/inspector_agent.h +165 -0
- package/src/headers/24/inspector_io.h +78 -0
- package/src/headers/24/inspector_permission.h +31 -0
- package/src/headers/24/inspector_profiler.h +149 -0
- package/src/headers/24/inspector_socket.h +60 -0
- package/src/headers/24/inspector_socket_server.h +110 -0
- package/src/headers/24/io_agent.h +30 -0
- package/src/headers/24/js_native_api.h +615 -0
- package/src/headers/24/js_native_api_types.h +211 -0
- package/src/headers/24/js_native_api_v8.h +485 -0
- package/src/headers/24/js_native_api_v8_internals.h +45 -0
- package/src/headers/24/js_stream.h +52 -0
- package/src/headers/24/json_parser.h +40 -0
- package/src/headers/24/json_utils.h +172 -0
- package/src/headers/24/logstream.h +81 -0
- package/src/headers/24/main_thread_interface.h +116 -0
- package/src/headers/24/memory_tracker-inl.h +454 -0
- package/src/headers/24/memory_tracker.h +333 -0
- package/src/headers/24/module_wrap.h +229 -0
- package/src/headers/24/ncrypto.h +1625 -0
- package/src/headers/24/network_agent.h +118 -0
- package/src/headers/24/network_inspector.h +45 -0
- package/src/headers/24/network_resource_manager.h +29 -0
- package/src/headers/24/node.h +1620 -0
- package/src/headers/24/node_api.h +269 -0
- package/src/headers/24/node_api_internals.h +46 -0
- package/src/headers/24/node_api_types.h +52 -0
- package/src/headers/24/node_binding.h +163 -0
- package/src/headers/24/node_blob.h +159 -0
- package/src/headers/24/node_bob-inl.h +36 -0
- package/src/headers/24/node_bob.h +107 -0
- package/src/headers/24/node_buffer.h +92 -0
- package/src/headers/24/node_builtins.h +223 -0
- package/src/headers/24/node_config_file.h +65 -0
- package/src/headers/24/node_constants.h +82 -0
- package/src/headers/24/node_context_data.h +168 -0
- package/src/headers/24/node_contextify.h +261 -0
- package/src/headers/24/node_crypto.h +62 -0
- package/src/headers/24/node_debug.h +25 -0
- package/src/headers/24/node_dir.h +52 -0
- package/src/headers/24/node_dotenv.h +45 -0
- package/src/headers/24/node_errors.h +391 -0
- package/src/headers/24/node_exit_code.h +54 -0
- package/src/headers/24/node_external_reference.h +167 -0
- package/src/headers/24/node_file-inl.h +412 -0
- package/src/headers/24/node_file.h +540 -0
- package/src/headers/24/node_http2.h +1175 -0
- package/src/headers/24/node_http2_state.h +159 -0
- package/src/headers/24/node_http_common-inl.h +198 -0
- package/src/headers/24/node_http_common.h +535 -0
- package/src/headers/24/node_i18n.h +132 -0
- package/src/headers/24/node_internals.h +476 -0
- package/src/headers/24/node_json.h +24 -0
- package/src/headers/24/node_large_page.h +34 -0
- package/src/headers/24/node_locks.h +180 -0
- package/src/headers/24/node_main_instance.h +67 -0
- package/src/headers/24/node_mem-inl.h +112 -0
- package/src/headers/24/node_mem.h +45 -0
- package/src/headers/24/node_messaging.h +389 -0
- package/src/headers/24/node_metadata.h +164 -0
- package/src/headers/24/node_modules.h +93 -0
- package/src/headers/24/node_mutex.h +323 -0
- package/src/headers/24/node_object_wrap.h +132 -0
- package/src/headers/24/node_options-inl.h +524 -0
- package/src/headers/24/node_options.h +682 -0
- package/src/headers/24/node_perf.h +166 -0
- package/src/headers/24/node_perf_common.h +102 -0
- package/src/headers/24/node_platform.h +286 -0
- package/src/headers/24/node_process-inl.h +26 -0
- package/src/headers/24/node_process.h +111 -0
- package/src/headers/24/node_realm-inl.h +153 -0
- package/src/headers/24/node_realm.h +236 -0
- package/src/headers/24/node_report.h +43 -0
- package/src/headers/24/node_revert.h +82 -0
- package/src/headers/24/node_root_certs.h +3546 -0
- package/src/headers/24/node_sea.h +74 -0
- package/src/headers/24/node_shadow_realm.h +46 -0
- package/src/headers/24/node_snapshot_builder.h +57 -0
- package/src/headers/24/node_snapshotable.h +174 -0
- package/src/headers/24/node_sockaddr-inl.h +257 -0
- package/src/headers/24/node_sockaddr.h +394 -0
- package/src/headers/24/node_sqlite.h +270 -0
- package/src/headers/24/node_stat_watcher.h +73 -0
- package/src/headers/24/node_string.h +101 -0
- package/src/headers/24/node_task_runner.h +92 -0
- package/src/headers/24/node_threadsafe_cow-inl.h +54 -0
- package/src/headers/24/node_threadsafe_cow.h +105 -0
- package/src/headers/24/node_trace_buffer.h +83 -0
- package/src/headers/24/node_trace_writer.h +75 -0
- package/src/headers/24/node_union_bytes.h +81 -0
- package/src/headers/24/node_url.h +101 -0
- package/src/headers/24/node_url_pattern.h +118 -0
- package/src/headers/24/node_v8.h +77 -0
- package/src/headers/24/node_v8_platform-inl.h +185 -0
- package/src/headers/24/node_version.h +110 -0
- package/src/headers/24/node_wasi.h +185 -0
- package/src/headers/24/node_wasm_web_api.h +55 -0
- package/src/headers/24/node_watchdog.h +154 -0
- package/src/headers/24/node_webstorage.h +60 -0
- package/src/headers/24/node_worker.h +159 -0
- package/src/headers/24/packet.h +155 -0
- package/src/headers/24/path.h +33 -0
- package/src/headers/24/permission/addon_permission.h +31 -0
- package/src/headers/24/permission/child_process_permission.h +31 -0
- package/src/headers/24/permission/fs_permission.h +167 -0
- package/src/headers/24/permission/inspector_permission.h +31 -0
- package/src/headers/24/permission/permission.h +100 -0
- package/src/headers/24/permission/permission_base.h +65 -0
- package/src/headers/24/permission/wasi_permission.h +31 -0
- package/src/headers/24/permission/worker_permission.h +31 -0
- package/src/headers/24/permission.h +100 -0
- package/src/headers/24/permission_base.h +65 -0
- package/src/headers/24/pipe_wrap.h +80 -0
- package/src/headers/24/preferredaddress.h +72 -0
- package/src/headers/24/protocol_helper.h +27 -0
- package/src/headers/24/queue.h +306 -0
- package/src/headers/24/req_wrap-inl.h +176 -0
- package/src/headers/24/req_wrap.h +79 -0
- package/src/headers/24/runtime_agent.h +41 -0
- package/src/headers/24/session.h +528 -0
- package/src/headers/24/sessionticket.h +108 -0
- package/src/headers/24/spawn_sync.h +243 -0
- package/src/headers/24/stream_base-inl.h +173 -0
- package/src/headers/24/stream_base.h +478 -0
- package/src/headers/24/stream_pipe.h +76 -0
- package/src/headers/24/stream_wrap.h +132 -0
- package/src/headers/24/streams.h +370 -0
- package/src/headers/24/string_bytes.h +109 -0
- package/src/headers/24/string_decoder-inl.h +31 -0
- package/src/headers/24/string_decoder.h +49 -0
- package/src/headers/24/target_agent.h +75 -0
- package/src/headers/24/tcp_wrap.h +105 -0
- package/src/headers/24/threadpoolwork-inl.h +70 -0
- package/src/headers/24/timer_wrap-inl.h +32 -0
- package/src/headers/24/timer_wrap.h +87 -0
- package/src/headers/24/timers.h +75 -0
- package/src/headers/24/tlscontext.h +228 -0
- package/src/headers/24/tokens.h +256 -0
- package/src/headers/24/trace_event.h +722 -0
- package/src/headers/24/trace_event_common.h +1109 -0
- package/src/headers/24/traced_value.h +129 -0
- package/src/headers/24/tracing_agent.h +43 -0
- package/src/headers/24/transportparams.h +166 -0
- package/src/headers/24/tty_wrap.h +65 -0
- package/src/headers/24/udp_wrap.h +230 -0
- package/src/headers/24/undici_version.h +6 -0
- package/src/headers/24/util-inl.h +711 -0
- package/src/headers/24/util.h +1016 -0
- package/src/headers/24/v8-external-memory-accounter.h +60 -0
- package/src/headers/24/v8-fast-api-calls.h +819 -0
- package/src/headers/24/v8-inspector.h +426 -0
- package/src/headers/24/wasi_permission.h +31 -0
- package/src/headers/24/worker_agent.h +40 -0
- package/src/headers/24/worker_inspector.h +124 -0
- package/src/headers/24/worker_permission.h +31 -0
- package/src/headers/24/zlib_version.h +6 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
#ifndef SRC_INSPECTOR_NETWORK_AGENT_H_
|
|
2
|
+
#define SRC_INSPECTOR_NETWORK_AGENT_H_
|
|
3
|
+
|
|
4
|
+
#include "env.h"
|
|
5
|
+
#include "io_agent.h"
|
|
6
|
+
#include "network_resource_manager.h"
|
|
7
|
+
#include "node/inspector/protocol/Network.h"
|
|
8
|
+
|
|
9
|
+
#include <map>
|
|
10
|
+
#include <memory>
|
|
11
|
+
#include <unordered_map>
|
|
12
|
+
|
|
13
|
+
namespace node {
|
|
14
|
+
namespace inspector {
|
|
15
|
+
|
|
16
|
+
class NetworkInspector;
|
|
17
|
+
|
|
18
|
+
// Supported charsets for devtools frontend on request/response data.
|
|
19
|
+
// If the charset is kUTF8, the data is expected to be text and can be
|
|
20
|
+
// formatted on the frontend.
|
|
21
|
+
enum class Charset {
|
|
22
|
+
kUTF8,
|
|
23
|
+
kBinary,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
struct RequestEntry {
|
|
27
|
+
double timestamp;
|
|
28
|
+
bool is_request_finished = false;
|
|
29
|
+
bool is_response_finished = false;
|
|
30
|
+
bool is_streaming = false;
|
|
31
|
+
Charset request_charset;
|
|
32
|
+
std::vector<protocol::Binary> request_data_blobs;
|
|
33
|
+
Charset response_charset;
|
|
34
|
+
std::vector<protocol::Binary> response_data_blobs;
|
|
35
|
+
|
|
36
|
+
RequestEntry(double timestamp, Charset request_charset, bool has_request_body)
|
|
37
|
+
: timestamp(timestamp),
|
|
38
|
+
is_request_finished(!has_request_body),
|
|
39
|
+
request_charset(request_charset),
|
|
40
|
+
response_charset(Charset::kBinary) {}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
class NetworkAgent : public protocol::Network::Backend {
|
|
44
|
+
public:
|
|
45
|
+
explicit NetworkAgent(
|
|
46
|
+
NetworkInspector* inspector,
|
|
47
|
+
v8_inspector::V8Inspector* v8_inspector,
|
|
48
|
+
Environment* env,
|
|
49
|
+
std::shared_ptr<NetworkResourceManager> network_resource_manager);
|
|
50
|
+
|
|
51
|
+
void Wire(protocol::UberDispatcher* dispatcher);
|
|
52
|
+
|
|
53
|
+
protocol::DispatchResponse enable() override;
|
|
54
|
+
|
|
55
|
+
protocol::DispatchResponse disable() override;
|
|
56
|
+
|
|
57
|
+
protocol::DispatchResponse getRequestPostData(
|
|
58
|
+
const protocol::String& in_requestId,
|
|
59
|
+
protocol::String* out_postData) override;
|
|
60
|
+
|
|
61
|
+
protocol::DispatchResponse getResponseBody(
|
|
62
|
+
const protocol::String& in_requestId,
|
|
63
|
+
protocol::String* out_body,
|
|
64
|
+
bool* out_base64Encoded) override;
|
|
65
|
+
|
|
66
|
+
protocol::DispatchResponse streamResourceContent(
|
|
67
|
+
const protocol::String& in_requestId,
|
|
68
|
+
protocol::Binary* out_bufferedData) override;
|
|
69
|
+
|
|
70
|
+
protocol::DispatchResponse loadNetworkResource(
|
|
71
|
+
const protocol::String& in_url,
|
|
72
|
+
std::unique_ptr<protocol::Network::LoadNetworkResourcePageResult>*
|
|
73
|
+
out_resource) override;
|
|
74
|
+
|
|
75
|
+
void emitNotification(v8::Local<v8::Context> context,
|
|
76
|
+
const protocol::String& event,
|
|
77
|
+
v8::Local<v8::Object> params);
|
|
78
|
+
|
|
79
|
+
void requestWillBeSent(v8::Local<v8::Context> context,
|
|
80
|
+
v8::Local<v8::Object> params);
|
|
81
|
+
|
|
82
|
+
void responseReceived(v8::Local<v8::Context> context,
|
|
83
|
+
v8::Local<v8::Object> params);
|
|
84
|
+
|
|
85
|
+
void loadingFailed(v8::Local<v8::Context> context,
|
|
86
|
+
v8::Local<v8::Object> params);
|
|
87
|
+
|
|
88
|
+
void loadingFinished(v8::Local<v8::Context> context,
|
|
89
|
+
v8::Local<v8::Object> params);
|
|
90
|
+
|
|
91
|
+
void dataSent(v8::Local<v8::Context> context, v8::Local<v8::Object> params);
|
|
92
|
+
|
|
93
|
+
void dataReceived(v8::Local<v8::Context> context,
|
|
94
|
+
v8::Local<v8::Object> params);
|
|
95
|
+
|
|
96
|
+
void webSocketCreated(v8::Local<v8::Context> context,
|
|
97
|
+
v8::Local<v8::Object> params);
|
|
98
|
+
void webSocketClosed(v8::Local<v8::Context> context,
|
|
99
|
+
v8::Local<v8::Object> params);
|
|
100
|
+
void webSocketHandshakeResponseReceived(v8::Local<v8::Context> context,
|
|
101
|
+
v8::Local<v8::Object> params);
|
|
102
|
+
|
|
103
|
+
private:
|
|
104
|
+
NetworkInspector* inspector_;
|
|
105
|
+
v8_inspector::V8Inspector* v8_inspector_;
|
|
106
|
+
std::shared_ptr<protocol::Network::Frontend> frontend_;
|
|
107
|
+
using EventNotifier = void (NetworkAgent::*)(v8::Local<v8::Context> context,
|
|
108
|
+
v8::Local<v8::Object>);
|
|
109
|
+
std::unordered_map<protocol::String, EventNotifier> event_notifier_map_;
|
|
110
|
+
std::map<protocol::String, RequestEntry> requests_;
|
|
111
|
+
Environment* env_;
|
|
112
|
+
std::shared_ptr<NetworkResourceManager> network_resource_manager_;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
} // namespace inspector
|
|
116
|
+
} // namespace node
|
|
117
|
+
|
|
118
|
+
#endif // SRC_INSPECTOR_NETWORK_AGENT_H_
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#ifndef SRC_INSPECTOR_NETWORK_INSPECTOR_H_
|
|
2
|
+
#define SRC_INSPECTOR_NETWORK_INSPECTOR_H_
|
|
3
|
+
|
|
4
|
+
#include <memory>
|
|
5
|
+
#include "env.h"
|
|
6
|
+
#include "network_agent.h"
|
|
7
|
+
#include "network_resource_manager.h"
|
|
8
|
+
|
|
9
|
+
namespace node {
|
|
10
|
+
class Environment;
|
|
11
|
+
|
|
12
|
+
namespace inspector {
|
|
13
|
+
|
|
14
|
+
class NetworkInspector {
|
|
15
|
+
public:
|
|
16
|
+
explicit NetworkInspector(
|
|
17
|
+
Environment* env,
|
|
18
|
+
v8_inspector::V8Inspector* v8_inspector,
|
|
19
|
+
std::shared_ptr<NetworkResourceManager> network_resource_manager);
|
|
20
|
+
~NetworkInspector();
|
|
21
|
+
|
|
22
|
+
void Wire(protocol::UberDispatcher* dispatcher);
|
|
23
|
+
|
|
24
|
+
bool canEmit(const std::string& domain);
|
|
25
|
+
|
|
26
|
+
void emitNotification(v8::Local<v8::Context> context,
|
|
27
|
+
const std::string& domain,
|
|
28
|
+
const std::string& method,
|
|
29
|
+
v8::Local<v8::Object> params);
|
|
30
|
+
|
|
31
|
+
void Enable();
|
|
32
|
+
void Disable();
|
|
33
|
+
bool IsEnabled() const { return enabled_; }
|
|
34
|
+
|
|
35
|
+
private:
|
|
36
|
+
bool enabled_;
|
|
37
|
+
Environment* env_;
|
|
38
|
+
std::unique_ptr<NetworkAgent> network_agent_;
|
|
39
|
+
std::shared_ptr<NetworkResourceManager> network_resource_manager_;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
} // namespace inspector
|
|
43
|
+
} // namespace node
|
|
44
|
+
|
|
45
|
+
#endif // SRC_INSPECTOR_NETWORK_INSPECTOR_H_
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// network_resource_manager.h
|
|
2
|
+
#ifndef SRC_INSPECTOR_NETWORK_RESOURCE_MANAGER_H_
|
|
3
|
+
#define SRC_INSPECTOR_NETWORK_RESOURCE_MANAGER_H_
|
|
4
|
+
|
|
5
|
+
#include <atomic>
|
|
6
|
+
#include <string>
|
|
7
|
+
#include <unordered_map>
|
|
8
|
+
#include "node_mutex.h"
|
|
9
|
+
|
|
10
|
+
namespace node {
|
|
11
|
+
namespace inspector {
|
|
12
|
+
|
|
13
|
+
class NetworkResourceManager {
|
|
14
|
+
public:
|
|
15
|
+
void Put(const std::string& url, const std::string& data);
|
|
16
|
+
std::string Get(const std::string& url);
|
|
17
|
+
|
|
18
|
+
// Erase resource and mapping by stream id
|
|
19
|
+
void Erase(const std::string& stream_id);
|
|
20
|
+
|
|
21
|
+
private:
|
|
22
|
+
std::unordered_map<std::string, std::string> resources_;
|
|
23
|
+
Mutex mutex_; // Protects access to resources_
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
} // namespace inspector
|
|
27
|
+
} // namespace node
|
|
28
|
+
|
|
29
|
+
#endif // SRC_INSPECTOR_NETWORK_RESOURCE_MANAGER_H_
|