Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
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.
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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.