Skip to content

Releases: bminer/ws-server-wrapper-go

v1.3.0

02 Oct 14:24

Choose a tag to compare

  • Defer JSON decoding of message arguments until handler invocation (#3)

    Previously Message.Arguments was of type []any, and inbound JSON messages were directly decoded into Arguments, probably as map[string]any values. Now, Message.Arguments is of type []json.RawMessage, which defers JSON decoding for each argument until the handler is invoked. Not only is performance improved in some cases, but now the JSON is decoded directly into the handler parameter types.

  • Fixed bugs and linter issues

  • Updated dependency

v1.2.0

02 May 18:02

Choose a tag to compare

  • Improved event handler invocations
  • Added Message.Processed method
  • Fixed some bugs

v1.1.0

25 Mar 15:07

Choose a tag to compare

  • Added ClientFromContext function to return the *Client from the Context passed to event handlers
  • Changed Accept function to close the client connection if the server has been closed

v1.0.0

25 Mar 15:17

Choose a tag to compare

First stable release!

Features:

  • Accept inbound WebSocket connections from any Go WebSocket library (coder/websocket fully supported)
  • Named channels per ws-wrapper specification
  • Add event handlers to Client or Server
  • Add one-time event handlers to Client or Server
  • Send events and requests to Clients individual clients
  • Broadcast events to all connected clients
  • Thread-safe in-memory key/value store for each Client (based on Go maps)
  • Intelligent calling of event handlers using reflection; supports context.Context as first argument and argument type conversions
  • Adapter for github.com/coder/websocket library

Example app provided here