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

spacesocket

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spacesocket

WebSocket server not invented here

  • 0.0.1
  • latest
  • npm
  • Socket score

Maintainers
1
Created
Source

WebSockets From Space*

* There are no users in space, only astronauts with the latest browser. Therefore no graceful fallback is attempted.

API

Setup

var server = http.createServer(...);
server.listen(port);

require('spacesocket').attach(server, function(conn) {
    dealWithWebSocket(conn);
});

Reading

conn.on('data', function(msg) {
    doStuffWithString(msg);
});

Writing

conn.write('Hello, World');

Closure

conn.end();

Buffer control

conn.on('drain', function() {
    // socket write queue is empty,
    // send until queueing again:
    while(conn.send(data)) { }
});

// Throttle sender for 1s:
conn.pause();
setTimeout(function() { conn.resume(); }, 1000);

FAQs


Did you know?

Socket

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.

Install

Related posts

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