Skip to content

Support WebSockets in LiteFS Proxy #427

@patte

Description

@patte

I successfully tested litefs on fly.io, but it seems that websocket connections are not working through the proxy.

The ws GET request arrives at the proxy, it gets proxied to the backend and in the browser I see a 101 Switching Protocols with the response headers and size 0. No messages are received. When I try to send a message from the browser the connection gets closed (Connection Closed: 1006).

2024-02-08T17:56:57Z app[178157ea245398] ams [info]level=INFO msg="proxy: GET /chat: node is primary, proxying to target"
2024-02-08T17:56:57Z app[178157ea245398] ams [info] INFO call: playground::chat: ams patte wants to connect ws

When I expose the backend port directly (so not going through the litefs proxy) everything works.

While writing this I found this thread in the forum, which seems to confirm that ws is not supported. It would be nice if this limitation is documented: Either litefs (with proxy) or websockets for one fly app.

Could I use litefs without the proxy and fly-replay write requests myself? How would I know if the local sqlitedb is synced up? I'd also be up to try to "fix" ws proxying in litefs if you think that would be a good idea to have and don't see any big roadblocks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions