iopsys-feed/quickjs-websocket
Vivek Dutta 3b53cd0088
quickjs-websocket: critical performance optimizations
- Check OPTIMIZATIONS.md for details
2026-01-09 10:53:51 +05:30
..
src quickjs-websocket: critical performance optimizations 2026-01-09 10:53:51 +05:30
Makefile quickjs-websocket: critical performance optimizations 2026-01-09 10:53:51 +05:30
OPTIMIZATIONS.md quickjs-websocket: critical performance optimizations 2026-01-09 10:53:51 +05:30
README.md quickjs-websocket: critical performance optimizations 2026-01-09 10:53:51 +05:30

WebSocket API for QuickJS

Introduction

This is an implementation of the W3C WebSocket API for the QuickJS JavaScript engine on top of the libwebsockets C library.

Usage

import { WebSocket } from '/usr/lib/quickjs/websocket.js'

const w = new WebSocket('wss://example.com/', ['protocol1', 'protocol2'])

globalThis.WebSocket = WebSocket // To make the API available globally

Limitations

Events emitted by WebSocket objects do not implement the full DOM event specification. Only a subset of properties is available. The EventTarget interface, i.e. addEventListener/removeEventListener, is unimplemented. The onopen/onerror/onclose/onmesseage handlers have to be used instead.