Skip to content

feat: define ws usage and public types #555

Closed

Description

@electrohyun

Problem

The ws work in #538 needs a stable usage and type contract for the supported API in #553.

Proposed API

import WebSocket, { WebSocketServer } from 'smocket/ws';

const server = new WebSocketServer({ port: 3000 });
const client = new WebSocket('ws://localhost:3000');

Define signatures and event arguments, including the supported request fields and constructor callback this.address(). Use direct imports with automatic Buffer handling and no public environment factory. Verify the contract with basic TypeScript examples; declaration generation, package entry points, and independent consumer checks belong to #562.

Socket.IO behavior

Keep existing Socket.IO APIs compatible. Use real ws as the reference for #553 and update ADR 0009 to reflect the agreed support.

Scope check

  • This is not reconnection, transport fallback, heartbeat, Redis multi-server, or binary encoding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions