Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

OpenSocketSessionOptions

interfaz

Opciones de openSocketSession.

ts
import type { OpenSocketSessionOptions } from "@meekojs/meeko/server";

Source code src/server/runtime/upgrade.ts:178

Declaración #

ts
interface OpenSocketSessionOptions {
	readonly hub: SocketHub
	readonly name: string
	readonly request: Request
	readonly roomId: string | undefined
	readonly peer: SocketPeer
	readonly maxPendingBytes: number
	onError?(error: unknown): void
}

Example #

ts
import type { OpenSocketSessionOptions } from "@meekojs/meeko/server";

const options: OpenSocketSessionOptions = { hub, name: "chat", request, roomId: "general", peer, maxPendingBytes: 64 * 1024 };

Miembros #

hub #

propiedad sólo lectura

readonly hub: SocketHub

Hub de la aplicación.

name #

propiedad sólo lectura

readonly name: string

Nombre del canal.

request #

propiedad sólo lectura

readonly request: Request

Petición del handshake sobre el origen público; el hub la vuelve a autorizar.

roomId #

propiedad sólo lectura

readonly roomId: string | undefined

Sala, si la hay.

peer #

propiedad sólo lectura

readonly peer: SocketPeer

Conexión ya aceptada por el transporte.

maxPendingBytes #

propiedad sólo lectura

readonly maxPendingBytes: number

Bytes entrantes retenidos mientras el hub autoriza la conexión.

onError #

método opcional

onError?(error: unknown): void

Observador de los fallos de la sesión.

See also #

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/server/runtime/upgrade.ts