@colyseus/ws-transport
TypeScript icon, indicating that this package has built-in type declarations

0.15.2 • Public • Published

@colyseus/ws-transport

import { Server } from "@colyseus/core";
import { WebSocketTransport } from "@colyseus/ws-transport";

const gameServer = new Server({
  transport: new WebSocketTransport(),
  // ...
})

Re-using existing http server and/or Express:

import http from "http";
import express from "express";
import { Server } from "@colyseus/core";
import { WebSocketTransport } from "@colyseus/ws-transport";

const app = express();
const server = http.createServer(app);

const gameServer = new Server({
  transport: new WebSocketTransport({ server }),
  // ...
})

Package Sidebar

Install

npm i @colyseus/ws-transport

Homepage

colyseus.io/

Weekly Downloads

4,978

Version

0.15.2

License

MIT

Unpacked Size

43.9 kB

Total Files

18

Last publish

Collaborators

  • endel