Skip to content

Releases

3.1.0

Choose a tag to compare

@mydoxie mydoxie released this 08 Nov 11:45
d8a9c31

No breaking change.

New

  • SocketAuth: a middleware that logs a socket in when it connects. The user is in socket.user. With no user, the client gets connect_error.
  • handshake.token: auth.token, else the Authorization: Bearer header.
  • handshake.cookie(name): reads a cookie, decrypted like req.cookie(name).
  • await handshake.session(): loads the Dox session of the client.
  • ServerOptions(allowedOrigins:): turns on an origin check, with the same rule as dox_core. [] allows the same host only, a list also allows those sites, ['*'] allows all. Other origins get 403. The default (null) keeps the 3.0.0 rule.
  • With no allowedOrigins, the server prints one warning at start that any site can connect.
final session = await handshake.session();
final user = await Auth(guard: 'web').userFromSession(session);

Fixes

  • Origin matching for cors ignores case and a trailing /.
  • handshake.token reads Bearer in any case.

Docs: Socket.IO

Full list: the CHANGELOG.

3.0.0

Choose a tag to compare

@necessarylion necessarylion released this 01 Nov 04:18
5fee664

The first stable release of dox_socketio.

A Socket.IO v4 server for Dox. It works with the official Socket.IO clients, and has a Redis adapter for many servers.

Docs: https://dartondox.dev/latest/packages/socketio/