New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ah-broadcaster-plugin

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ah-broadcaster-plugin

action hero broadcaster plugin

  • 0.1.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

ah-broadcaster-plugin

Helps broadcasting a message to every client connection in a channel. Most important difference from chat, it doesn't let clients broadcast anything to anyone.

How to install

npm install ah-broadcaster-plugin --save

Don't forget to enable plugin in action hero config (config/api.js).

How to use

There are three methods in this plugin: join, leave and broadcast.

api.channel.join (connection id, channel id, callback)

You can add any connection to a channel by id anytime you need.

api.channel.join(connection.id, 'my_channel');

api.channel.leave (connection id, channel id, callback)

You can remove any connection from a channel by id anytime you need.

api.channel.leave(connection.id, 'my_channel');

api.channel.broadcast (channel id, data, callback)

You can broadcast any message to a channel using this method.

api.channel.broadcast('my_channel', {message: 'hello'});

Try sending your message to channel "all" for boradcasting every client:

api.channel.broadcast('all', {message: 'hello'});

Keywords

FAQs

Package last updated on 31 Oct 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc