Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

docker-exec-websocket-client

Package Overview
Dependencies
Maintainers
5
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docker-exec-websocket-client - npm Package Compare versions

Comparing version 1.4.0 to 3.0.0

src/client.debug.js

23

package.json
{
"name": "docker-exec-websocket-client",
"version": "1.4.0",
"version": "3.0.0",
"scripts": {
"test": "./test/runtests.sh"
"test": "mocha ./test/test.js"
},

@@ -16,15 +16,15 @@ "license": "MPL-2.0",

"debug": "^4.1.1",
"through2": "^3.0.1",
"ws": "^7.1.2"
"through2": "^4.0.2",
"ws": "^8.4.2"
},
"devDependencies": {
"assume": "^2.2.0",
"docker-exec-websocket-server": "^1.4.0",
"eslint": "^6.4.0",
"docker-exec-websocket-server": "^3.0.0",
"eslint": "^8.8.0",
"express": "^4.17.1",
"mocha": "^6.2.0",
"mocha": "^9.2.0",
"term.js": "^0.0.7"
},
"engines": {
"node": ">8.0"
"node": ">12.0"
},

@@ -35,3 +35,8 @@ "repository": {

},
"bugs": "https://github.com/taskcluster/docker-exec-websocket-client/issues"
"bugs": "https://github.com/taskcluster/docker-exec-websocket-client/issues",
"mocha": {
"ui": "tdd",
"timeout": "40s",
"reporter": "spec"
}
}
# docker-exec-websocket-client
## Purpose
Client for docker-exec-websocket-server.
Client for [docker-exec-websocket-server](https://github.com/taskcluster/docker-exec-websocket-server).

@@ -34,2 +34,15 @@ ## Usage

Docker 1.6.1 or above must be installed with a container named `servertest` running with `cat` and `/bin/bash` capabilities to inject the exec process into. From there, `npm test` will carry out the test.
Ensure Docker is installed.
To test locally:
* Run ``yarn install`` to install the dependencies, including developer dependencies
* Run ``yarn test``
* You can pass environment variables and commands to mocha as well, such as ``DEBUG=* yarn test -f 'docker exec wc'``
To test with ``docker-compose``, similar to CI:
* Run ``docker-compose build --build-arg NODE_VERSION=16-bullseye``, or change to the desired
[Node.js image tag](https://hub.docker.com/_/node/)
* Run ``docker-compose run --rm test``
* Repeat ``docker-compose build ...`` when the code changes or you want to try a different Node.js image.
var assert = require('assert');
var debug = require('debug')('docker-exec-websocket-server:lib:client');
var debugdata = require('debug')('docker-exec-websocket-server:lib:rcv');
var debug = require('debug')('docker-exec-websocket-client:lib:client');
var debugdata = require('debug')('docker-exec-websocket-client:lib:rcv');
var EventEmitter = require('events').EventEmitter;

@@ -123,3 +123,3 @@ var msgcode = require('./messagecodes.js');

messageHandler(messageEvent) {
var message = new Buffer(new Uint8Array(messageEvent.data));
var message = Buffer.from(new Uint8Array(messageEvent.data));
debugdata(message);

@@ -181,3 +181,3 @@ // the first byte is the message code

} else {
var buf = new Buffer(4);
var buf = Buffer.alloc(4);
buf.writeUInt16LE(h, 0);

@@ -191,7 +191,7 @@ buf.writeUInt16LE(w, 2);

sendCode(code) {
this.strbuf.write(new Buffer([code]));
this.strbuf.write(Buffer.from([code]));
}
sendMessage(code, data) {
this.strbuf.write(Buffer.concat([new Buffer([code]), new Buffer(data)]));
this.strbuf.write(Buffer.concat([Buffer.from([code]), Buffer.from(data)]));
}

@@ -198,0 +198,0 @@

@@ -15,4 +15,4 @@ module.exports = {

shutdown: 201, // Server shut down
error: 202 // Some internal error occurred, expect undefined behaviour
error: 202, // Some internal error occurred, expect undefined behaviour
//may carry utf8 payload regarding error reason
};
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