
Security News
TC39 Advances 11 Proposals for Math Precision, Binary APIs, and More
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
docker-exec-websocket-server
Advanced tools
## Purpose A server that serves the results of docker exec over websockets.
A server that serves the results of docker exec over websockets.
See docker-exec-websocket-client
for a client that communicates with this server.
Server:
var DockerServer = require('../lib/server.js');
var dockerServer = new DockerServer({
port:8080, //automatically creates http server
//OR
server: //http.Serv object, can also be https, should already be listening
path: '/'+slugid.v4(), //Path to WebSocket
containerId: 'servertest', //Container to inject exec proccess into
dockerSocket: '/var/run/docker.sock' //location of docker remote API socket
maxSessions: 10 //maximum number of connected sessions
});
await dockerServer.execute();
By default, uses /var/run/docker.sock
to communicate with Docker.
Messages are prepended with a single byte which contains information about the encoded message. The payload is a Buffer
in node, or a UInt8Array
in browserify.
// stream related message types (carries a payload)
stdin: 0,
stdout: 1,
stderr: 2,
// data-flow related message types (carries no payload)
resume: 100, // Process is now ready to receive data
pause: 101, // Process is processing current data, don't send more right now
// resolution related message types
stopped: 200, // Process exited, payload is single byte exit code
shutdown: 201, // Server shut down
error: 202 // Some internal error occurred, expect undefined behaviour
Ensure Docker is installed (docker -v
).
To test locally:
yarn install
to install the dependencies, including developer dependenciesyarn test
DEBUG=* yarn test -f 'docker exec wc'
To test with docker-compose
, similar to CI:
docker-compose build --build-arg NODE_VERSION=16-bullseye
, or change to the desired
Node.js image tagdocker-compose run --rm test
docker-compose build ...
when the code changes or you want to try a different Node.js image.FAQs
## Purpose A server that serves the results of docker exec over websockets.
The npm package docker-exec-websocket-server receives a total of 36 weekly downloads. As such, docker-exec-websocket-server popularity was classified as not popular.
We found that docker-exec-websocket-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
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.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.