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

engine.io

Package Overview
Dependencies
Maintainers
1
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

engine.io

The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.8M
decreased by-13.22%
Maintainers
1
Weekly downloads
 
Created

What is engine.io?

The engine.io npm package is a core component for building real-time web applications. It is designed to be efficient and includes a robust WebSocket and polling implementation. Engine.io provides a low-level API that handles the WebSocket connections, including fallbacks to alternative protocols if WebSockets are not supported by the client or server environments. This makes it an excellent choice for developing applications that require real-time bidirectional event-based communication.

What are engine.io's main functionalities?

Server Initialization

This feature allows you to initialize an engine.io server. You can listen for connections and handle messages and disconnections from clients.

const { Server } = require('engine.io');
const server = new Server({ /* options */ });
server.on('connection', (socket) => {
  console.log('a user connected');
  socket.on('message', (data) => {
    console.log(data);
  });
  socket.on('close', () => {
    console.log('user disconnected');
  });
});

Client Initialization

This feature demonstrates how to initialize a connection to an engine.io server from the client side. It includes handling open, message, and close events.

const { Socket } = require('engine.io-client');
const socket = new Socket('ws://localhost');
socket.on('open', () => {
  console.log('connection established');
  socket.send('Hello server!');
});
socket.on('message', (data) => {
  console.log(data);
});
socket.on('close', () => {
  console.log('connection closed');
});

Other packages similar to engine.io

FAQs

Package last updated on 12 Mar 2014

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