Skip to main content
Module

x/grm/deps.ts>SocksClient

MTProto API Client for Deno 🦕
Go to Latest
class SocksClient
implements SocksClient
extends EventEmitter
import { SocksClient } from "https://deno.land/x/grm@0.5.1/deps.ts";

Constructors

new
SocksClient(options: SocksClientOptions)

Properties

private
nextRequiredPacketBufferSize: number
private
onClose: (hadError: boolean) => void
private
onConnect: () => void
private
onDataReceived: (data: Buffer) => void
private
onError: (err: Error) => void
private
options: SocksClientOptions
private
receiveBuffer: ReceiveBuffer
private
socket: Duplex
private
socks5ChosenAuthType: number
private
state: SocksClientState
readonly
socksClientOptions: SocksClientOptions

Methods

Static Methods

createConnection(options: SocksClientOptions, callback?: Function): Promise<SocksClientEstablishedEvent>
createConnectionChain(options: SocksClientChainOptions, callback?: Function): Promise<SocksClientEstablishedEvent>
createUDPFrame(options: SocksUDPFrameDetails): Buffer
parseUDPFrame(data: Buffer): SocksUDPFrameDetails
interface SocksClient
import { type SocksClient } from "https://deno.land/x/grm@0.5.1/deps.ts";

Methods

on(event: "error", listener: (err: SocksClientError) => void): this
on(event: "bound", listener: (info: SocksClientBoundEvent) => void): this
on(event: "established", listener: (info: SocksClientEstablishedEvent) => void): this
once(event: string, listener: (...args: any[]) => void): this
once(event: "error", listener: (err: SocksClientError) => void): this
once(event: "bound", listener: (info: SocksClientBoundEvent) => void): this
once(event: "established", listener: (info: SocksClientEstablishedEvent) => void): this
emit(event: string | symbol, ...args: any[]): boolean
emit(event: "error", err: SocksClientError): boolean
emit(event: "bound", info: SocksClientBoundEvent): boolean
emit(event: "established", info: SocksClientEstablishedEvent): boolean