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

devebot-api

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

devebot-api - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

30

index.js

@@ -22,4 +22,3 @@ 'use strict';

self.execCommand = function(command, callback) {
var wsUrl = util.format('ws://%s:%s%s/execute', config.host, config.port, config.path);
var ws = new WebSocket(wsUrl);
var ws = buildWebsocketClient(config);

@@ -77,2 +76,3 @@ var wsCommand = {

ws.on('close', function handler(code, message) {
self.emit('close', code, message);
logger.debug(' - Websocket@client is closed, code: %s, message: %s', code, message);

@@ -82,2 +82,3 @@ });

ws.on('error', function handler(error) {
self.emit('error', error);
logger.debug(' - Websocket@client encounter an error: %s', error);

@@ -92,2 +93,27 @@ });

var buildWebsocketClient = function(config) {
var wsOpts = {};
if (config.authen instanceof Object) {
wsOpts.headers = wsOpts.headers || {};
if (config.authen.token_jwt) {
wsOpts.headers["Authorization"] = "JWT " + config.authen.token_jwt;
}
if (config.authen.token_key && config.authen.token_secret) {
wsOpts.headers["X-Token-Key"] = config.authen.token_key;
wsOpts.headers["X-Token-Secret"] = config.authen.token_secret;
}
}
var sslEnabled = (config.tunnel instanceof Object && config.tunnel.enabled);
if (sslEnabled) {
wsOpts.rejectUnauthorized = config.tunnel.rejectUnauthorized || false;
}
var wsUrl = util.format('%s://%s:%s%s/execute',
sslEnabled?'wss':'ws', config.host, config.port, config.path);
return new WebSocket(wsUrl, null, wsOpts);
};
var emptyFunction = function() {};

@@ -94,0 +120,0 @@

2

package.json
{
"name": "devebot-api",
"version": "0.1.4",
"version": "0.1.5",
"description": "Devebot API",

@@ -5,0 +5,0 @@ "main": "index.js",

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