Skip to main content
Deno 2 is finally here 🎉️
Learn more
Latest
class Transport
extends EventEmitter<never, never, TransportEvents>
Abstract
import { Transport } from "https://deno.land/x/socket_io@0.2.0/packages/engine.io/lib/transport.ts";

Constructors

new
Transport(opts: ServerOptions)

Properties

protected
readonly
opts: ServerOptions
protected
readyState: ReadyState
abstract
readonly
name: string

The name of the transport

abstract
readonly
upgradesTo: string[]

The list of transports to upgrade to

writable: boolean

Methods

protected
abstract
doClose(): void

Closes the transport.

protected
onClose()

Called upon transport close.

protected
onData(data: RawData)

Called with the encoded packet data.

protected
onError(message: string)

Called when the transport encounters a fatal error.

protected
onPacket(packet: Packet)

Called with a parsed packet from the data stream.

Manually closes the transport.

abstract
onRequest(req: Request, responseHeaders: Headers): Promise<Response>

Called with an incoming HTTP request.

abstract
send(packets: Packet[]): void

Writes an array of packets.