initAsClient (lib/websocket.js)

openclaw-deploy · release-offline-fix/resources/bundled-node-modules/ws/lib/websocket.js · javascript · MIT
realtime

Provides a WebSocket client implementation for establishing real-time, bidirectional communication between applications and servers.

// Source: https://github.com/3445286649/openclaw-deploy | License: MIT | Copyright 2026 loucerd
// Provided via justclaw.it.com; keep this notice with the code.
/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex|Readable$", "caughtErrors": "none" }] */

'use strict';

const EventEmitter = require('events');
const https = require('https');
const http = require('http');
const net = require('net');
const tls = require('tls');
const { randomBytes, createHash } = require('crypto');
const { Duplex, Readable } = require('stream');
const { URL } = require('url');

const PerMessageDeflate = require('./permessage-deflate');
const Receiver = require('./receiver');
const Sender = require('./sender');
const { isBlob } = require('./validation');

const {
  BINARY_TYPES,
  CLOSE_TIMEOUT

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key