summaryrefslogtreecommitdiff
path: root/ext/websocket
AgeCommit message (Collapse)Author
2023-11-19fix(ext,runtime): add missing custom inspections (#21219)Kenta Moriuchi
2023-11-17chore: forward v1.38.2 release commit to main (#21236)denobot
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-11-10chore: forward v1.38.1 release commit to main (#21144)denobot
This is the release commit being forwarded back to main for 1.38.1 Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com> Co-authored-by: littledivy <littledivy@users.noreply.github.com>
2023-11-021.38.0 (#21051)denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-11-01feat(ext/websocket): websockets over http2 (#21040)Matt Mastracci
Implements `WebSocket` over http/2. This requires a conformant http/2 server supporting the extended connect protocol. Passes approximately 100 new WPT tests (mostly `?wpt_flags=h2` versions of existing websockets APIs). This is implemented as a fallback when http/1.1 fails, so a server that supports both h1 and h2 WebSockets will still end up on the http/1.1 upgrade path. The patch also cleas up the websockets handshake to split it up into http, https+http1 and https+http2, making it a little less intertwined. This uncovered a likely bug in the WPT test server: https://github.com/web-platform-tests/wpt/issues/42896
2023-10-31feat(ext/websocket): use rustls-tokio-stream instead of tokio-rustls (#20518)Matt Mastracci
Use new https://github.com/denoland/rustls-tokio-stream project instead of tokio-rustls for direct websocket connections. This library was written from the ground up to be more reliable and should help with various bugs that may occur due to underlying bugs in the old library. Believed to fix #20355, #18977, #20948
2023-10-30feat(ext/websocket): split websocket read/write halves (#20579)Matt Mastracci
Fixes some UB when sending and receiving at the same time.
2023-10-25chore: update deno_core and port all remaining ops to `op2` (#20954)Bartek Iwańczuk
Signed-off-by: Matt Mastracci <matthew@mastracci.com> Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-10-13chore: forward v1.37.2 release commit to main (#20897)denobot
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-10-11feat(WebSocketStream): rename connection to opened (#20878)Leo Kettmeir
2023-10-10fix(ext/web): writability of `ReadableStream.from` (#20836)Luca Casonato
Fixes a WPT in `URL` and `ReadableStream`. Some unrelated WPT expectation changes due to WPT update.
2023-10-04refactor: rewrite websocket to use op2 macro (#20140)Divy Srivastava
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-09-27chore: forward v1.37.1 release commit to main (#20706)denobot
This is the release commit being forwarded back to main for 1.37.1 Co-authored-by: littledivy <littledivy@users.noreply.github.com>
2023-09-191.37.0 (#20574)denobot
Co-authored-by: David Sherret <dsherret@gmail.com>
2023-09-13chore: bump deno_core and cargo update (#20480)Matt Mastracci
Bump deno_core, pulling in new rusty_v8. Requires some op2/deprecation fixes.
2023-09-07feat: support import attributes (#20342)David Sherret
2023-09-04Revert "refactor: rewrite ops that use 'deferred' to use 'op2(async(lazy))' ↵Bartek Iwańczuk
(#20303) (#20370) This reverts commit https://github.com/denoland/deno/commit/83426be6eead06c680ae527468aeaf8723543ff2. Includes a regression test.
2023-09-02refactor: rewrite ops that use 'deferred' to use 'op2(async(lazy))' (#20303)Bartek Iwańczuk
Rewrites 3 ops that used "op(deferred)" to use "op2(async(lazy))" instead. This will allow us to remove codepath for handling "deferred" ops in "deno_core".
2023-09-01chore: forward v1.36.4 to main (#20352)Bartek Iwańczuk
Co-authored-by: denobot <33910674+denobot@users.noreply.github.com>
2023-08-26chore: update to Rust 1.72 (#20258)林炳权
<!-- Before submitting a PR, please read https://deno.com/manual/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. --> As the title. --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-08-24chore: forward v1.36.3 release commit to main (#20270)denobot
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-08-23fix(ext/web): add stream tests to detect v8slice split bug (#20253)Matt Mastracci
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-08-20perf(ext/event): always set timeStamp to 0 (#20191)Bartek Iwańczuk
```js Deno.bench(function eventNew() { new Event("foo"); }); ``` <b>main</b> ``` ./target/release/deno bench event_bench.js cpu: Apple M1 Max runtime: deno 1.36.1 (aarch64-apple-darwin) file:///Users/ib/dev/deno/event_bench.js benchmark time (avg) iter/s (min … max) p75 p99 p995 --------------------------------------------------------------- ----------------------------- eventNew 36.43 ns/iter 27,451,874.9 (35.15 ns … 46.98 ns) 37.68 ns 40.7 ns 41.69 ns ``` <b>this PR</b> ``` ./target/release/deno bench event_bench.js cpu: Apple M1 Max runtime: deno 1.36.1 (aarch64-apple-darwin) file:///Users/ib/dev/deno/event_bench.js benchmark time (avg) iter/s (min … max) p75 p99 p995 --------------------------------------------------------------- ----------------------------- eventNew 13.71 ns/iter 72,958,970.0 (12.85 ns … 31.79 ns) 15.11 ns 16.49 ns 17.5 ns ``` Towards #20167
2023-08-10chore: forward v1.36.1 to main (#20119)Divy Srivastava
Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: littledivy <littledivy@users.noreply.github.com>
2023-08-10chore: upgrade fastwebsockets to 0.4.4 (#19089)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/19041
2023-08-031.36.0 (#20036)denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2023-07-31fix: call setIsTrusted for generated events (MessageEvent) (#19919)Ricardo Iván Vieitez Parra
This addresses issue #19918. ## Issue description Event messages have the wrong isTrusted value when they are not triggered by user interaction, which differs from the browser. In particular, all MessageEvents created by Deno have isTrusted set to false, even though it should be true. This is my first ever contribution to Deno, so I might be missing something.
2023-07-28feat(ext/websocket): allow HTTP(S) protocol in URL (#19862)Leo Kettmeir
Closes #19093
2023-07-261.35.3 (#19947)denobot
Bumped versions for 1.35.3 Co-authored-by: mmastrac <mmastrac@users.noreply.github.com>
2023-07-20chore: forward v1.35.2 release commit to main (#19887)denobot
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-07-12chore: forward 1.35.1 back to main (#19814)David Sherret
2023-07-07perf(ext/websocket): optimize server websocket js (#19719)Divy Srivastava
Split from https://github.com/denoland/deno/pull/19686 - timestamp set to 0 for server websocket events. - take fast call path with op_ws_send_binary.
2023-07-051.35.0 (#19717)denobot
Bumped versions for 1.35.0 Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-07-03fix(dts): make globals available on globalThis (#19438)ud2
This PR changes Web IDL interfaces to be declared with `var` instead of `class`, so that accessing them via `globalThis` does not raise type errors. Closes #13390.
2023-06-29fix(ext/websocket): Ensure that errors are available after async response ↵Matt Mastracci
returns (#19642) Fixes the WPT tests that test w/invalid codes. Also explicitly ignoring some h2 tests to hopefully prevent flakes. The previous changes to WebSocketStream introduced a bug where the close errors were not made available if the `pull` method was re-entrant.
2023-06-22refactor(serde_v8): split ZeroCopyBuf into JsBuffer and ToJsBuffer (#19566)Bartek Iwańczuk
`ZeroCopyBuf` was convenient to use, but sometimes it did hide details that some copies were necessary in certain cases. Also it made it way to easy for the caller to pass around and convert into different values. This commit splits `ZeroCopyBuf` into `JsBuffer` (an array buffer coming from V8) and `ToJsBuffer` (a Rust buffer that will be converted into a V8 array buffer). As a result some magical conversions were removed (they were never used) limiting the API surface and preparing for changes in #19534.
2023-06-16chore: forward v1.34.3 release commit to main (#19526)denobot
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-06-13fix(ext/websockets): ensure we fully send frames before close (#19484)Matt Mastracci
Fixes #19483
2023-06-09chore: forward v1.34.2 release commit to main (#19434)denobot
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-06-08fix(ext/websocket): Close socket on bad string data (#19424)Matt Mastracci
2023-06-08perf(ext/websocket): Reduce GC pressure & monomorpize op_ws_next_event (#19405)Matt Mastracci
Reduce the GC pressure from the websocket event method by splitting it into an event getter and a buffer getter. Before: 165.9k msg/sec After: 169.9k msg/sec
2023-06-08perf: use sendto syscalls (#19414)Bartek Iwańczuk
This switches syscall used in HTTP and WS server from "writev" to "sendto". "DENO_USE_WRITEV=1" can be used to enable using "writev" syscall. Doing this for easier testing of various setups.
2023-06-07perf(ext/websocket): monomorphize code (#19394)Bartek Iwańczuk
Using `deopt-explorer` I found that a bunch of fields on `WebSocket` class were polymorphic. Fortunately it was enough to initialize them to `undefined` to fix the problem.
2023-06-06perf(ext/websocket): Make send sync for non-stream websockets (#19376)Matt Mastracci
No need to go through the async machinery for `send(String | Buffer)` -- we can fire and forget, and then route any send errors into the async call we're already making (`op_ws_next_event`). Early benchmark on MacOS: Before: 155.8k msg/sec After: 166.2k msg/sec (+6.6%) Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-06-06refactor(core): ensureFastOps is an op-generating proxy (#19377)Matt Mastracci
Startup benchmark shows no changes (within 1ms, identical system/user times).
2023-06-05chore: update deno_lint to 0.46.0 (#19372)Kenta Moriuchi
2023-06-05perf: optimize RegExp usage in JS (#19364)Bartek Iwańczuk
Towards https://github.com/denoland/deno/issues/19330 Shows about 1% improvement in the HTTP benchmark.
2023-05-29chore: forward v1.34.1 to main (#19312)Bartek Iwańczuk
Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2023-05-241.34.0 (#19246)denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-18chore: forward v1.33.4 release commit to main (#19181)denobot
**THIS PR HAS GIT CONFLICTS THAT MUST BE RESOLVED** This is the release commit being forwarded back to main for 1.33.4 Please ensure: - [x] Everything looks ok in the PR - [ ] The release has been published To make edits to this PR: ```shell git fetch upstream forward_v1.33.4 && git checkout -b forward_v1.33.4 upstream/forward_v1.33.4 ``` Don't need this PR? Close it. cc @levex Co-authored-by: levex <levex@users.noreply.github.com> Co-authored-by: Levente Kurusa <lkurusa@kernelstuff.org>