Opinionated wrapper around Gorilla Websocket that:
- Provides
Connectionfor client and server that automatically:- Handles ping/pong, and resets ping schedule on read/write as necessary.
- Handles close messages, and closes the connection.
- Makes awaiting a connection-closure easy with a context, and close-reason with context-cause.
- Provides a
Server[E]that maintains the set of active connections and their metadata (generic for customization). - Provides a
Dialfunction to get a connection to an endpoint as client. - Provides a
Clientthat handles reconnects. - Provides Go typing for websocket message-types.
- Provides a
Messengerinterface for common client/connection message handling (read/write/close).
MIT, see LICENSE file.