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

@pubkeeper/brew-websocket

Package Overview
Dependencies
Maintainers
2
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pubkeeper/brew-websocket

Websocket Brew for Pubkeeper

  • 5.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by44.44%
Maintainers
2
Weekly downloads
 
Created
Source

Pubkeeper WebSocket Brew

Installation

In a browser:

<script src="pubkeeper-brew-websocket.js"></script>

Using npm:

$ npm install --save @pubkeeper/brew-websocket

Then, load using ES5 require() syntax…

var WebSocketBrew = require('@pubkeeper/brew-websocket').WebSocketBrew;

…or with ES2015+ import syntax:

import { WebSocketBrew } from '@pubkeeper/brew-websocket';

Usage

Simple example, pointing to localhost

const wsb = new WebSocketBrew({
  brewerConfig: {
    hostname: '127.0.0.1',
    port: 8080,
    secure: false,
  },
});

With multiple servers…

const wsbLocal = new WebSocketBrew({
  name: 'websocket-local',
  brewerConfig: {
    hostname: '127.0.0.1',
    port: 8080,
    secure: false,
  },
});

const wsbShared = new WebSocketBrew({
  name: 'websocket-shared',
  brewerConfig: {
    hostname: '10.10.0.21',
    port: 443,
    secure: true,
  },
});

const brews = [wsbLocal, wsbShared];

WebSocketBrew Class

The WebSocketBrew provides the connection management layer to publish to and read from the Pubkeeper WebSocket server.

new WebSocketBrew(options)

NameTypeDescription
optionsBrewOptionsThe options for this pubkeeper client
BrewOptions : object

These options can be given to a WebSocketBrew to customize its behavior.

NameTypeDefaultDescription
namestring'websocket'brew name/id
brewerConfigBrewerConfig?nullThe brew's brewer configuration
loopbackbooleantrueEnable/Disbale loopback messages
maxRetriesnumber7Maximum number of connection retries
maxTimeoutnumber10000Maximum timeout between retries (in milliseconds)
BrewerConfig : object
NameTypeDescription
hostnamestringhostname of the WebSocket server
portnumberport of the WebSocket server
securebooleanuse wss:// or ws:// for server communication

Members

.name : string

Return the configured name of this brew.

FAQs

Package last updated on 01 Mar 2019

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