Skip to content

Latest commit

 

History

History
47 lines (39 loc) · 774 Bytes

README.md

File metadata and controls

47 lines (39 loc) · 774 Bytes

WebSocket v1.0.0

Create fast, high-level WebSocket API servers.

Basic Server

// TypeScript
import { Server } from "@illuxdev/oxide-websocket";

const server = new Server({
	port: 3549,
});

server
	.run()
	.then(() => {
		console.log(
			"The server is running at port 3549",
			"Address = ws://0.0.0.0:3549"
		);
	})
	.catch((error) => {
		console.log("The server failed to start", "Error = " + error);
	});
// JavaScript
const { Server } = require("@illuxdev/oxide-websocket");

const server = new Server({
	port: 3549,
});

server
	.run()
	.then(() => {
		console.log(
			"The server is running at port 3549",
			"Address = ws://0.0.0.0:3549"
		);
	})
	.catch((error) => {
		console.log("The server failed to start", "Error = " + error);
	});