Socket
Socket
Sign inDemoInstall

bull-admin-panel

Package Overview
Dependencies
111
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bull-admin-panel

An admin panel of Bull based on WebSocket.


Version published
Weekly downloads
81
decreased by-35.71%
Maintainers
1
Install size
24.6 MB
Created
Weekly downloads
 

Readme

Source

bull-admin-panel

npm version Actions Status

An admin panel of Bull based on WebSocket.

Installation

npm install bull-admin-panel

Screenshots

Example

more details...

const express = require('express');
const http = require('http');
const Bull = require('bull');
const BullAdminPanel = require('bull-admin-panel');

const app = express();
const server = http.createServer(app);
const queue = new Bull('queue-name', {
  redis: {
    host: 'localhost',
    port: 6379,
    db: 1
  }
});

app.use('/bull', new BullAdminPanel({
  basePath: '/bull',
  verifyClient: (info, callback) => {
    // Do authorization for WebSocket.
    // https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback
    callback(true);
  },
  queues: [queue],
  server: server
}));

// Launch server
server.listen(8000, 'localhost', () => {
  const {address, port} = server.address();
  console.log(`Server listening at http://${address}:${port}`);
});

Work with nginx

bull-admin-panel use WebSocket. You need config upgrade request.
NGINX as a WebSocket Proxy

location / {
    proxy_pass http://127.0.0.1:8080;
    proxy_http_version 1.1;
    proxy_set_header Host $host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $http_connection;
}

Options

basePath

Type: string
Required: required
The bull admin panel base path. We pass to frontend app.

socketValidationPath

Type: string
Required: optional
The default value is copy from basePath. The websocket just accepts to connect via this path.
If your site has rewrite path settings. You can use this option.

verifyClient

Type: function(info: object, callback: function)
Required: required
For websocket authorization.
More information:

queues

Type: Array<Bull>
Required: required
Bull instances.

const Bull = require('bull');
const queues = [
  new Bull('queue-a', 'redis://localhost:6379/0'),
  new Bull('queue-b', 'redis://localhost:6379/0')
];

server

Type: http.Server
Required: required
The node.js http.Server instance.

Develop

Fork this repository then clone it.

  1. Install node modules.
    npm install

  2. Start the develop server.
    npm start

Keywords

FAQs

Last updated on 14 Aug 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc