Socket
Socket
Sign inDemoInstall

@geckos.io/server

Package Overview
Dependencies
69
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @geckos.io/server

Real-time client/server communication over UDP using WebRTC and Node.js


Version published
Weekly downloads
110
increased by5.77%
Maintainers
1
Created
Weekly downloads
 

Readme

Source
logo

@geckos.io/server

NPM version Downloads Node version Snyk Vulnerabilities for GitHub Repo (Specific Manifest) NPM Codecov ES Modules Badge

Real-time client/server communication over UDP using WebRTC and Node.js.

This framework fits perfectly with your next HTML5 real-time multiplayer games or chat app.

Read the documentation for more information.

Install

npm install @geckos.io/server

How to use

import geckos from '@geckos.io/server'

const io = geckos()

io.listen()

io.onConnection(channel => {
  channel.onDisconnect(() => {
    console.log(`${channel.id} got disconnected`)
  })

  channel.on('chat message', data => {
    console.log(`got ${data} from "chat message"`)
    // emit the "chat message" data to all channels in the same room
    io.room(channel.roomId).emit('chat message', data)
  })
})

Keywords

FAQs

Last updated on 10 Dec 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc