socket.io-deno

Socket.IO server for Deno

ISC License

Stars
105
Committers
2

Bot releases are visible (Hide)

socket.io-deno - 0.2.0 Latest Release

Published by darrachequesne about 2 years ago

Bug Fixes

  • engine: properly pause the polling transport during upgrade (c706741), closes #4
  • restore socket.to() and socket.except() methods (4ce5f64), closes #3
  • server: send events once the handshake is completed (518f534)

Features

  • implement catch-all listeners (333dfdd)

Syntax:

io.on("connection", (socket) => {
  socket.onAnyIncoming((event, ...args) => {
    // ...
  });

  socket.onAnyOutgoing((event, ...args) => {
    // ...
  });
});
  • implement the Redis adapter (39eaa0e)
import { serve } from "https://deno.land/[email protected]/http/server.ts";
import {
  createRedisAdapter,
  createRedisClient,
  Server,
} from "https://deno.land/x/[email protected]/mod.ts";

const [pubClient, subClient] = await Promise.all([
  createRedisClient({
    hostname: "localhost",
  }),
  createRedisClient({
    hostname: "localhost",
  }),
]);

const io = new Server({
  adapter: createRedisAdapter(pubClient, subClient),
});

await serve(io.handler(), {
  port: 3000,
});

Diff: https://github.com/socketio/socket.io-deno/compare/0.1.1...0.2.0

socket.io-deno - 0.1.1

Published by darrachequesne about 2 years ago

Bug Fixes

  • disallow duplicate WebSocket connections with same sid (193a9b5)
  • disallow mismatching transport (6b2cc16)
  • prevent crash when using custom headers (dfe3122)
  • send a "noop" packet when transport is already closed (3b1eb82)

Diff: https://github.com/socketio/socket.io-deno/compare/0.1.0...0.1.1

socket.io-deno - 0.1.0

Published by darrachequesne about 2 years ago

This is the first release of this library 🚀