
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
pull-ws-server
Advanced tools
create pull stream websockets, servers, and clients.
one duplex service you may want to use this with is muxrpc
var ws = require('pull-ws-server')
var pull = require('pull-stream')
ws.createServer(function (stream) {
//pipe duplex style to your service.
pull(stream, service.createStream(), stream)
})
.listen(9999)
var stream = ws.connect('ws://localhost:9999')
pull(stream, client.createStream(), stream)
if the connection fails, the first read from the stream will be an error, otherwise, to get a handle of stream end/error pass a callback to connect.
ws.connect('ws://localhost:9999', function (err, stream) {
if(err) return handleError(err)
//stream is now ready
})
To run the server over TLS:
var tlsOpts = {
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};
ws.createServer(tlsOpts, function (stream) {
//pipe duplex style to your service.
pull(stream, service.createStream(), stream)
})
.listen(9999)
To add client-authentication to the server, you can set verifyClient.
Documentation here.
function verifyClient (info) {
return info.secure == true
}
ws.createServer({ verifyClient: verifyClient }, onStream)
if you have an http server that you also need to serve stuff
over, and want to use a single port, use the server option.
var http = require('http')
var server = http.createServer(function(req, res){...}).listen(....)
ws.createServer({server: server}, function (stream) { ... })
MIT
FAQs
wrap pull streams around ws server and client
The npm package pull-ws-server receives a total of 10 weekly downloads. As such, pull-ws-server popularity was classified as not popular.
We found that pull-ws-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.