Skip to main content
Home

Built and signed on GitHub Actions

High-performance web framework

This package works with Cloudflare Workers, Node.js, Deno, Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
100%
Published
2 weeks ago (0.16.0)
interface BunWebSocketHandler

WebSocket handler configuration for Bun runtime

Properties

Maximum allowed message size in bytes

Maximum time in seconds the WebSocket can be idle before being closed

Methods

optional
open(ws: ServerWebSocket): void | Promise<void>

Handler for when a connection is opened

optional
message(
ws: ServerWebSocket,
message: string | Buffer,
): void | Promise<void>

Handler for when a message is received

optional
close(
ws: ServerWebSocket,
code?: number,
reason?: string,
): void | Promise<void>

Handler for when a connection is closed

optional
error(
ws: ServerWebSocket,
error: Error,
): void | Promise<void>

Handler for when a connection encounters an error

optional
drain(ws: ServerWebSocket): void | Promise<void>

Handler for when the connection is drained (backpressure is relieved)

optional
ping(
ws: ServerWebSocket,
data: Buffer,
): void | Promise<void>

Handler for ping frames

optional
pong(
ws: ServerWebSocket,
data: Buffer,
): void | Promise<void>

Handler for pong frames

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@rabbit-company/web

Import symbol

import { type BunWebSocketHandler } from "@rabbit-company/web";
or

Import directly with a jsr specifier

import { type BunWebSocketHandler } from "jsr:@rabbit-company/web";

Add Package

pnpm i jsr:@rabbit-company/web
or (using pnpm 10.8 or older)
pnpm dlx jsr add @rabbit-company/web

Import symbol

import { type BunWebSocketHandler } from "@rabbit-company/web";

Add Package

yarn add jsr:@rabbit-company/web
or (using Yarn 4.8 or older)
yarn dlx jsr add @rabbit-company/web

Import symbol

import { type BunWebSocketHandler } from "@rabbit-company/web";

Add Package

vlt install jsr:@rabbit-company/web

Import symbol

import { type BunWebSocketHandler } from "@rabbit-company/web";

Add Package

npx jsr add @rabbit-company/web

Import symbol

import { type BunWebSocketHandler } from "@rabbit-company/web";

Add Package

bunx jsr add @rabbit-company/web

Import symbol

import { type BunWebSocketHandler } from "@rabbit-company/web";