Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: overhaul peer and message interface #70

Merged
merged 6 commits into from
Aug 15, 2024
Merged

feat!: overhaul peer and message interface #70

merged 6 commits into from
Aug 15, 2024

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Aug 15, 2024

overhaul Peer and Message objects to be forward compatible and more compatible with web standards.

(refer to the updated docs)

Message:

  • New message.id
  • New message.event
  • New message.peer
  • New message.data
  • New message.json()
  • New message.arrayBuffer()
  • New message.uint8Array()
  • New message.blob()
  • Removed `message.isBinary (use new runtime safe methods)

Peer:

  • Renamed peer.addr to peer.remoteAddress
  • You can access upgrade request with standard peer.request
    • Moved peer.url / peer.headers to peer.request.url / peer.request.headers
  • You can access peer websocket with standard peer.webSocket
    • Moved peer.readyState to peer.webSocket.readyState
    • Compatibility added for url, extensions, protocol and readyState

@pi0 pi0 self-assigned this Aug 15, 2024
Copy link

cloudflare-workers-and-pages bot commented Aug 15, 2024

Deploying crossws with  Cloudflare Pages  Cloudflare Pages

Latest commit: ff28eca
Status:⚡️  Build in progress...

View logs

@pi0 pi0 marked this pull request as ready for review August 15, 2024 19:04
@pi0 pi0 merged commit c8518ff into main Aug 15, 2024
2 of 3 checks passed
@pi0 pi0 deleted the feat/message-utils branch August 15, 2024 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant