Skip to content

Add web socket support to Relic #2497

Closed

Description

@vlidholt

We should support web sockets in Relic to make it possible to communicate in real-time. We can add an abstract WebSocketRoute, which will automatically upgrade the connection. A helper method for this based on shelf_web_socket can be placed in the serverpod_relic_helpers package (see #2495).

The handleCall method is overridden to call an abstract method that handles the upgraded connection.

@override
Future<void> handleWebSocketChannel(Session session, IOWebSocketChannel channel);

We may also want to add properties and/or overrides to WebSocketRoute for things like protocol, allowed origins, ping interval, etc.

Activity

  1. added
    enhancement
    on Jul 18, 2024
  2. added
    area: web server
    on Aug 29, 2024
  3. brianquinlan commented on Dec 5, 2024

    @brianquinlan

    You may want to consider using the WebSocket interface - it has simpler semantics than WebSocketChannel.

    But I don't think that it is a big deal.

  4. moved this to Later 🥳 in Serverpod Frameworkson Mar 5, 2025
  5. moved this to Later 🥳 in Serverpod Frameworkson Jun 16, 2025
  6. moved this from Later 🥳 to Now 🔥 in Serverpod Frameworkson Jun 16, 2025
  7. nielsenko commented on Aug 4, 2025

    @nielsenko
    Collaborator

    With #3625 a route can return a ConnectContext in its handler (with `ctx.connect(..)), which allow it to setup web-socket handling.

    Note: Interface is different. There is no separate method, but a different returned context from the handler. Also, we use the new WebSocket (https://pub.dev/packages/web_socket) over WebSocketChannel.

  8. moved this from In Progress 🔥 to Done 🚀 in Serverpod Frameworkson Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: web serverenhancement

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions