🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

@socket.io/azure-service-bus-adapter

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@socket.io/azure-service-bus-adapter

The Socket.IO adapter for Azure Service Bus, allowing to broadcast events between several Socket.IO servers

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Socket.IO Azure Service Bus adapter

The @socket.io/azure-service-bus-adapter package allows broadcasting packets between multiple Socket.IO servers.

Table of contents

  • Supported features
  • Installation
  • Usage
  • Options
  • License

Supported features

Featuresocket.io versionSupport
Socket management4.0.0:white_check_mark: YES (since version 0.1.0)
Inter-server communication4.1.0:white_check_mark: YES (since version 0.1.0)
Broadcast with acknowledgements4.5.0:white_check_mark: YES (since version 0.1.0)
Connection state recovery4.6.0:x: NO

Installation

npm install @socket.io/azure-service-bus-adapter

Usage

import { ServiceBusClient, ServiceBusAdministrationClient } from "@azure/service-bus";
import { Server } from "socket.io";
import { createAdapter } from "@socket.io/azure-service-bus-adapter";

const connectionString = "Endpoint=...";

const serviceBusClient = new ServiceBusClient(connectionString);
const serviceBusAdminClient = new ServiceBusAdministrationClient(connectionString);

const io = new Server({
  adapter: createAdapter(serviceBusClient, serviceBusAdminClient)
});

// wait for the creation of the pub/sub subscription
await io.of("/").adapter.init();

io.listen(3000);

Options

NameDescriptionDefault value
topicNameThe name of the topic.socket.io
topicOptionsThe options used to create the topic.-
subscriptionPrefixThe prefix of the subscription (one subscription will be created per Socket.IO server in the cluster).socket.io
receiverOptionsThe options used to create the subscription.-
topicOptionsThe options used to create the receiver.-
heartbeatIntervalThe number of ms between two heartbeats.5_000
heartbeatTimeoutThe number of ms without heartbeat before we consider a node down.10_000

License

MIT

Keywords

socket.io

FAQs

Package last updated on 22 Mar 2024

Did you know?

Socket

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.

Install

Related posts