ws-web
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

ws-web

NPM Version

Use ws in the browser over Web Streams.

  • No polyfills or dependencies.
  • 144KB gzipped.
  • Tested with Bun.

Installation

pnpm i ws-web

Usage

import { WebSocket } from "ws-web";

const ws = new WebSocket("ws://fake.com", [], {
    proxyStreams: (readable: ReadableStream, writable: WritableStream) => {
        // TLS should be handled by the user. Raw data is exchanged here.
    },
})

Only the client is supported.

Development

bun i
bun demo
# Navigate to http://localhost:3000

Building

bun i
bun package

Readme

Keywords

none

Package Sidebar

Install

npm i ws-web

Weekly Downloads

10

Version

1.0.3

License

MIT

Unpacked Size

579 kB

Total Files

5

Last publish

Collaborators

  • kylecarbs