Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Releases: unjs/crossws

v0.3.4

10 Feb 20:41
Compare
Choose a tag to compare
Loading

compare changes

🚀 Enhancements

  • cloudflare: SupportresolveDurableStub (#130)

🩹 Fixes

  • Global publish via first subscribed peer (#103)
  • Definerequest.context as read-only (#133)
  • node, uws: Send data as blob only if it is not string (#124)
  • bun: Passcode andreason toclose hook (#132)

💅 Types

  • Stricter type declarations (#129)
  • Specify an explicit return type foruint8Array() (#128)

📖 Documentation

  • node: Checkupgrade === "websocket" in example (#131)
  • Add dynamic example for changeable resolve (e5daf22)

❤️ Contributors

Contributors

  • @pi0
  • @sandros94
  • @eltigerchino
  • @TecToast
pi0, sandros94, and 2 other contributors
Assets2
Loading
shinGangan reacted with heart emojishinGangan reacted with eyes emoji
1 person reacted

v0.3.3

24 Jan 21:06
3bb5269
This commit was created on GitHub.com and signed with GitHub’sverified signature.
GPG key ID:B5690EEEBB952194
Verified
Learn about vigilant mode.
Compare
Choose a tag to compare
Loading

compare changes

🚀 Enhancements

  • Allow throwing error with.response prop inupgrade (#113)

❤️ Contributors

Contributors

  • @LukeHagar
LukeHagar
Loading

v0.3.2

22 Jan 11:16
Compare
Choose a tag to compare
Loading

compare changes

Note

🔑 This release includes enhancements to make authentication and session handling easier.

  • You can validate therequest param in theupgrade hook andthrow aResponse as an error to terminate the upgrade (#91)
  • You can access a shared context fromrequest.context in theupgrade hook and frompeer.context in the other hooks to preserve session data (#110,#111 (Note: context can be volatile in some environments likecloudflare-durable)

🩹 Fixes

  • types:peer.request always has.headers if defined (e915f8d)
  • types: Markpeer.request as always defined (8fbb59b)

📖 Documentation

  • Fix typos (#84,#85)
  • Add tip for usingdestr for JSON parsing (#109)

🏡 Chore

  • examples: Fix typo (#107)

❤️ Contributors

Contributors

  • @jamaluddinrumi
  • @pi0
  • @LukeHagar
  • @sandros94
  • @39sho
jamaluddinrumi, pi0, and 3 other contributors
Loading
becem-gharbi and LukeHagar reacted with thumbs up emojisandros94 and LukeHagar reacted with heart emoji
3 people reacted

v0.3.1

10 Sep 21:11
Compare
Choose a tag to compare
Loading

compare changes

🩹 Fixes

  • types:AdapterOptions type (#80)

❤️ Contributors

Loading
maxdzin and shinGangan reacted with heart emojishinGangan reacted with eyes emoji
2 people reacted

v0.3.0

04 Sep 20:14
Compare
Choose a tag to compare
Loading

compare changes

Important

Since this is a major version, ecosystem migration takes time. Stay tuned forlisthen,h3 andnitro dependency upgrades.

🌟 What is new?

Better stability

Crossws 0.3.x includes an overhaul of refactors, stability improvements, and new features. A new codebase and testing matrix had been implemented (#55) to make sure all supported adapters and runtimes work as expected and are consistent with each other.

Refined Peer API

The peer object allows easy interaction with connected WebSocket clients from server route hooks (peer docs).

To improve Web standards compatibility, accessing upgrade URL and headers is now possible withpeer.request.url andpeer.request.headers (breaking change), andpeer.addr is also renamed topeer.remoteAddress to improve readability (breaking change) and support is increased across providers. You can also use new lazy-generated and securepeer.id (UUID v4) for various purposes including temporary sessions or persistent state.

Two new methods are now supported to close connected peers usingpeer.close(code, reason) andpeer.terminate(). With this new version, you can access a standardWebSocket interface usingpeer.websocket.

Note

Today many of the server runtimes don't provide a spec-compliantWebSocket API. Crossws uses an internal proxy to polyfill consistent access toextensions,protocol, andreadyState. Seecompatibility table for more details.

Refined Message API

Onmessagehook, you receive a message object containing data from the client (message docs).

Parsing incoming messages can be tricky across runtimes. Message object now has stable methods.text(),.json(),.uint8Array(),.arrayBuffer(),.blob() to safely read message as desired format. If you need, you can also access.rawData,.peer,.event (if available), and lazy generated secure UUID v4.id

Authentication viaupgrade hook

When you need to authenticate and validate WebSocket clients before they can upgrade, you can now easily use theupgrade hook to check incoming URLs and headers/cookies and return a Web StandardResponse in case you need to abort the upgrade.

Pubsub with Deno and Cloudflare Durable Objects

One of the common use cases of WebSockets is pubsub. This release adds pub-sub support toDeno provider and also you can globally broadcast messages usingws.publish for advanced use cases.

Normally with cloudflare workers, it is not possible to connect multiple peers with each other. CloudflareDurable Objects (available on paid plans) allows building collaborative editing tools, interactive chat, multiplayer games, and applications that need coordination among multiple clients.

Crossws provides a new composable method to easily integrate WebSocket handlers with Durable Objects. Hibernation is supported out of the box to reduce billing costs when connected clients are inactive. (durable object peer docs)

Changelog

🚀 Enhancements

  • ⚠️ Overhaul internal implementation (#55)
  • ⚠️ Overhaul peer and message interface (#70)
  • node, uws: Automatically detect binary message type (#53)
  • peer: Addpeer.close() andpeer.terminate() support (#36)
  • Cloudflare durable objects support (#54) (docs)
  • deno: Support pub/sub (#58)
  • Universal access to all peers (#60)
  • Global publish usingws.publish (#61)
  • Experimental SSE-based adapter to support websocket in limited runtimes (#62,#66,#68) (docs
  • peer: Use secure lazy random UUID v4 (#64)

🩹 Fixes

  • Should not serailize binary messages (#39)
  • cloudflare-durable: Restore peer url and id after hibernation (#71)

💅 Refactors

  • ⚠️ Movepeer.ctx topeer._internal (#59)
  • ⚠️ Remove adapter hooks (#72)
  • Rename internal crossws to hooks (bb4c917)
  • Better internal organization (2744f21)

📖 Documentation

#22,76fc105,7dacb00,#46,#45,#44,a96dca3,898ab49,2e49cc3

📦 Build

  • Remove optionaluWebSockets.js dependency (#52,b23b76d)
  • ⚠️ Esm-only build (#63)

✅ Tests

  • Add adapter tests (#56)
  • cloudflare: Use random port for wrangler inspector (a46265c)
  • Run tests with web standardWebSocket andEventSource (#67)

❤️ Contributors

Contributors

  • @beer
beer
Loading
luc122c, huang-julien, balu-lt, CS-Birb, joshmossas, mehotkhan, evil1morty, maxdzin, ParasSolanki, becem-gharbi, and 8 more reacted with heart emojijuliomrqz and sadeghbarati reacted with rocket emojishinGangan reacted with eyes emoji
18 people reacted

v0.2.4

26 Feb 13:18
Compare
Choose a tag to compare
Loading

compare changes

🚀 Enhancements

  • Auto generated peer id (a3b61f5)
  • Basic pubsub support for node (4bd61ca)

💅 Refactors

  • Improve peer inspect message (9f7e1f0)

📖 Documentation

🏡 Chore

❤️ Contributors

Loading
shinGangan reacted with heart emojishinGangan and luc122c reacted with eyes emoji
2 people reacted

v0.2.3

25 Feb 20:38
Compare
Choose a tag to compare
Loading

compare changes

🩹 Fixes

  • node: Respectx-forwarded for client id (3f8bd0c)

❤️ Contributors

Loading
shinGangan and sadeghbarati reacted with heart emoji
2 people reacted

v0.2.2

25 Feb 19:42
Compare
Choose a tag to compare
Loading

compare changes

🩹 Fixes

🏡 Chore

  • example: Handle secure origins (7f8639f)

❤️ Contributors

Loading
shinGangan reacted with heart emojishinGangan reacted with eyes emoji
1 person reacted

v0.2.1

25 Feb 18:54
Compare
Choose a tag to compare
Loading

compare changes

🩹 Fixes

  • $callHook should check hook existence (40082ba)

📖 Documentation

❤️ Contributors

Loading
shinGangan reacted with heart emojishinGangan reacted with eyes emoji
1 person reacted

v0.2.0

25 Feb 17:21
Compare
Choose a tag to compare
Loading

compare changes

⚠️ Breaking Changes

  • ⚠️ Improve types and api (2ebacd3)

❤️ Contributors

Loading
shinGangan reacted with heart emojishinGangan reacted with eyes emoji
1 person reacted
Previous1
Previous

[8]ページ先頭

©2009-2025 Movatter.jp