Skip to content

Support websockets #27

Description

@ulrikstrid

We need a way to support websockets.

For httpaf we can use this to upgrade the connection: https://github.com/anmonteiro/httpaf/blob/fork/lib/httpaf.mli#L640.
For h2 we can just take the TCP connection and do the same thing, if we want to support it at all.

The biggest problem is how to build the API.
My current thought is that we should add a function to the request to get hold of a socket (basically a way to send and receive data, maybe via Lwt_stream.t). And then to close the connection we return the response, but that might feel weird since we've actually already responded.
Another solution would be to have a Socket body that does the same thing but then the term body is overloaded.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions