summaryrefslogtreecommitdiff
path: root/ext/websocket/lib.rs
AgeCommit message (Collapse)Author
2023-04-23chore: remove tokio-tungstenite dependency (#18814)Bartek Iwańczuk
2023-04-23refactor(ext/websocket): Remove dep on tungstenite by reworking code (#18812)Matt Mastracci
2023-04-22feat(ext/http): Rework Deno.serve using hyper 1.0-rc3 (#18619)Matt Mastracci
This is a rewrite of the `Deno.serve` API to live on top of hyper 1.0-rc3. The code should be more maintainable long-term, and avoids some of the slower mpsc patterns that made the older code less efficient than it could have been. Missing features: - `upgradeHttp` and `upgradeHttpRaw` (`upgradeWebSocket` is available, however). - Automatic compression is unavailable on responses.
2023-04-21fix(ext/websocket): upgrade fastwebsockets to 0.2.4 (#18791)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/18775
2023-04-20refactor(ext/websocket): use fastwebsockets client (#18725)Divy Srivastava
2023-04-06perf(ext/websocket): replace tokio_tungstenite server with fastwebsockets ↵Divy Srivastava
(#18587) https://github.com/littledivy/fastwebsockets ``` # This PR ./load_test 100 0.0.0.0 8080 0 0 Running benchmark now... Msg/sec: 176355.000000 # main ./load_test 100 0.0.0.0 8080 0 0 Running benchmark now... Msg/sec: 157198.750000 ```
2023-03-31perf(ext/websocket): efficient event kind serialization (#18509)Divy Srivastava
Use u16 to represent the kind of event (0 - 6) & event code > 6 is treated as the close code. This way we can represent all events + the close code in a single JS number. This is safe because (as per RFC 6455) close code from 0-999 are reserved & not used. | name | avg msg/sec/core | | --- | --- | | deno_main | `127820.750000` | | deno #18506 | `140079.000000` | | deno #18506 + this | `150104.250000` |
2023-03-30perf(ext/websocket): special op for sending binary data frames (#18506)Divy Srivastava
Easy perf win by avoiding deserializing `SendValue` through serde_v8. | name | avg msg/sec/core | | --- | --- | | deno_main | `127820.750000` | | deno_this | `140079.000000` |
2023-03-30perf(ext/websocket): special op for sending text data frames (#18507)Divy Srivastava
Similar to #18506 but for Text frames.
2023-03-19chore: bump http to ^0.29.0 (#18259)Max
`http` is very stable, it's safe to "unpin" it from `=0.28.0` version. This helps embedders that depend on newer version of `http` crate.
2023-03-17perf(core) Reduce copying and cloning in extension initialization (#18252)Matt Mastracci
Follow-up to #18210: * we are passing the generated `cfg` object into the state function rather than passing individual config fields * reduce cloning dramatically by making the state_fn `FnOnce` * `take` for `ExtensionBuilder` to avoid more unnecessary copies * renamed `config` to `options`
2023-03-17feat(core) deno_core::extension! macro to simplify extension registration ↵Matt Mastracci
(#18210) This implements two macros to simplify extension registration and centralize a lot of the boilerplate as a base for future improvements: * `deno_core::ops!` registers a block of `#[op]`s, optionally with type parameters, useful for places where we share lists of ops * `deno_core::extension!` is used to register an extension, and creates two methods that can be used at runtime/snapshot generation time: `init_ops` and `init_ops_and_esm`. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-09refactor: Split extension registration for runtime and snapshotting (#18095)Bartek Iwańczuk
This commit splits "<ext_name>::init" functions into "init_ops" and "init_ops_and_esm". That way we don't have to construct list of ESM sources on each startup if we're running with a snapshot. In a follow up commit "deno_core" will be changed to not have a split between "extensions" and "extensions_with_js" - it will be embedders' responsibility to pass appropriately configured extensions. Prerequisite for https://github.com/denoland/deno/pull/18080
2023-03-09refactor(core): Extension::builder_with_deps (#18093)Bartek Iwańczuk
Prerequisite for https://github.com/denoland/deno/pull/18080
2023-03-07refactor(core): don't use Result in ExtensionBuilder::state (#18066)Bartek Iwańczuk
There's no point for this API to expect result. If something fails it should result in a panic during build time to signal to embedder that setup is wrong.
2023-02-07 refactor: remove prefix from include_js_files & use extension name (#17683)Leo Kettmeir
2023-02-07refactor: Use ES modules for internal runtime code (#17648)Leo Kettmeir
This PR refactors all internal js files (except core) to be written as ES modules. `__bootstrap`has been mostly replaced with static imports in form in `internal:[path to file from repo root]`. To specify if files are ESM, an `esm` method has been added to `Extension`, similar to the `js` method. A new ModuleLoader called `InternalModuleLoader` has been added to enable the loading of internal specifiers, which is used in all situations except when a snapshot is only loaded, and not a new one is created from it. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-02-05 refactor: rename `deno` specifiers to `internal` (#17655)Leo Kettmeir
2023-01-27chore: upgrade to Rust 1.67 (#17548)David Sherret
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-20Revert "perf(ext/websocket): optimize socket.send (#16320)" (#17480)Leo Kettmeir
This reverts commit 36307c45
2023-01-08feat(core): allow specifying name and dependencies of an Extension (#17301)Leo Kettmeir
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-12-07fix(ext/websocket): Reland make try_send ops infallible (#16968)Divy Srivastava
Reverts denoland/deno#16743 This fixes the server hangs we were seeing in benchy. cc @billywhizz
2022-11-21Revert "fix(ext/websocket): make try_send ops infallible (#16454)" (#16743)Bartek Iwańczuk
This reverts commit d76014192dbfd134794a6129e73f38645d7e6314.
2022-11-01revert 9ea0ce61981aa09851c3d1e0a2b7dbd7f7a392f5 (#16501)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/16450
2022-10-31fix(ext/websocket): make try_send ops infallible (#16454)Divy Srivastava
Fixes #16450
2022-10-19perf(ext/websocket): optimize `op_ws_next_event` (#16325)Divy Srivastava
Towards https://github.com/denoland/deno/issues/16315
2022-10-19perf(ext/websocket): optimize socket.send (#16320)Divy Srivastava
Towards #16315
2022-10-15fix(ext/websocket): panic on no next ws message from an already closed ↵Aapo Alasuutari
stream (#16004)
2022-09-27feat: Add requesting API name to permission prompt (#15936)Bartek Iwańczuk
Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
2022-09-06perf(runtime): short-circuit `queue_async_op` for Poll::Ready (#15773)Divy Srivastava
2022-08-18feat(ext/flash): An optimized http/1.1 server (#15405)Divy Srivastava
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl> Co-authored-by: crowlkats <crowlkats@toaxl.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-08-04fix: increase websocket message size (#15406)Leo Kettmeir
2022-05-23fix(ext/websocket): WebSocket dispatch single close event (#13443)Leo Kettmeir
2022-04-04chore(ext/websocket): custom arity (#14202)Divy Srivastava
2022-03-17fix: cargo publish fails without absolute paths (#13993)Ryan Dahl
This reverts commit 4e3ed37037a2aa1edeac260dc3463a81d9cf9b88. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-03-14feat(ops): custom arity (#13949)Aaron O'Mullan
Also cleanup & drop ignored wildcard op-args
2022-03-14feat(core): codegen ops (#13861)Divy Srivastava
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
2022-03-14chore: improve build times for `ext/` changes (#13927)Divy Srivastava
2022-01-15chore: upgrade to rust 1.58 (#13377)David Sherret
2022-01-07chore: update copyright to 2022 (#13306)Ryan Dahl
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2022-01-06feat(ext/websocket): server automatically handle ping/pong for incoming ↵Leo Kettmeir
WebSocket (#13172)
2022-01-05feat(ext/websocket): add header support to WebSocketStream (#11887)Leo Kettmeir
2021-12-16feat: support abort reasons in Deno APIs and `WebSocketStream` (#13066)Andreu Botella
2021-12-07chore: upgrade to rustls 0.20 (#12488)Ryan Dahl
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Bert Belder <bertbelder@gmail.com>
2021-12-01refactor: cli doesn't need to depend on deno_tls (#12952)Ryan Dahl
also move create_http_client to deno_fetch
2021-11-28fix(websocket): bad rid on WebSocketStream abort(#12913)Andreu Botella
Fix a bad resource ID error when aborting a WebSocketStream immediately after its creation.
2021-11-10refactor(ext/http): rewrite hyper integration and fix bug (#12732)Bert Belder
Fixes: #12193 Fixes: #12251 Closes: #12714
2021-11-09Revert "refactor(ext/http): rewrite hyper integration and fix bug (#12332)" ↵Luca Casonato
(#12704) This reverts commit 5b1e537446454f6332de44adbeb6a15ff072c2fa.
2021-11-08refactor(ext/http): rewrite hyper integration and fix bug (#12332)Bert Belder
Fixes: #12193