
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
@socket.io/postgres-adapter
Advanced tools
The Socket.IO Postgres adapter, allowing to broadcast events between several Socket.IO servers
The @socket.io/postgres-adapter
package allows broadcasting packets between multiple Socket.IO servers.
Table of contents
Feature | socket.io version | Support |
---|---|---|
Socket management | 4.0.0 | :white_check_mark: YES (since version 0.1.0 ) |
Inter-server communication | 4.1.0 | :white_check_mark: YES (since version 0.1.0 ) |
Broadcast with acknowledgements | 4.5.0 | :white_check_mark: YES (since version 0.3.0 ) |
Connection state recovery | 4.6.0 | :x: NO |
npm install @socket.io/postgres-adapter
import { Server } from "socket.io";
import { createAdapter } from "@socket.io/postgres-adapter";
import pg from "pg";
const io = new Server();
const pool = new pg.Pool({
user: "postgres",
host: "localhost",
database: "postgres",
password: "changeit",
port: 5432,
});
pool.query(`
CREATE TABLE IF NOT EXISTS socket_io_attachments (
id bigserial UNIQUE,
created_at timestamptz DEFAULT NOW(),
payload bytea
);
`);
pool.on("error", (err) => {
console.error("Postgres error", err);
});
io.adapter(createAdapter(pool));
io.listen(3000);
0.4.0 (2024-07-17)
This release contains an important refactor of the adapter (this commit), as most of the logic has been moved in the ClusterAdapter
class of the socket.io-adapter
package.
FAQs
The Socket.IO Postgres adapter, allowing to broadcast events between several Socket.IO servers
The npm package @socket.io/postgres-adapter receives a total of 43,936 weekly downloads. As such, @socket.io/postgres-adapter popularity was classified as popular.
We found that @socket.io/postgres-adapter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.