Lines Matching defs:const
3 const {
13 const Buffer = require('buffer').Buffer;
14 const crypto = require('crypto');
15 const { ERR_DEBUGGER_ERROR } = require('internal/errors').codes;
16 const { EventEmitter } = require('events');
17 const http = require('http');
18 const URL = require('url');
20 const debuglog = require('internal/util/debuglog').debuglog('inspect');
22 const kOpCodeText = 0x1;
23 const kOpCodeClose = 0x8;
25 const kFinalBit = 0x80;
26 const kReserved1Bit = 0x40;
27 const kReserved2Bit = 0x20;
28 const kReserved3Bit = 0x10;
29 const kOpCodeMask = 0xF;
30 const kMaskBit = 0x80;
31 const kPayloadLengthMask = 0x7F;
33 const kMaxSingleBytePayloadLength = 125;
34 const kMaxTwoBytePayloadLength = 0xFFFF;
35 const kTwoBytePayloadLengthField = 126;
36 const kEightBytePayloadLengthField = 127;
37 const kMaskingKeyWidthInBytes = 4;
41 const WEBSOCKET_HANDSHAKE_GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11';
44 const err = new ERR_DEBUGGER_ERROR(`${message}`);
51 const expectedResponseKeyBase = requestKey + WEBSOCKET_HANDSHAKE_GUID;
52 const shasum = crypto.createHash('sha1');
54 const shabuf = shasum.digest();
64 const dataLength = payload.length;
86 const header = Buffer.from([
91 const mask = Buffer.alloc(4);
92 const masked = Buffer.alloc(dataLength);
101 const dataAvailable = data.length;
102 const notComplete = { closed: false, payload: null, rest: data };
106 const firstByte = data[0];
107 const secondByte = data[1];
109 const final = (firstByte & kFinalBit) !== 0;
110 const reserved1 = (firstByte & kReserved1Bit) !== 0;
111 const reserved2 = (firstByte & kReserved2Bit) !== 0;
112 const reserved3 = (firstByte & kReserved3Bit) !== 0;
113 const opCode = firstByte & kOpCodeMask;
114 const masked = (secondByte & kMaskBit) !== 0;
115 const compressed = reserved1;
159 const payloadEnd = payloadOffset + payloadLength;
182 const {
195 const payloadStr = payloadBuffer.toString();
197 const lastChar = payloadStr[payloadStr.length - 1];
209 const { id, method, params, result, error } = payload;
211 const handler = this._pending[id];
245 const data = { id: ++this._lastId, method, params };
250 const json = JSONStringify(data);
258 const httpReq = http.get({
264 const chunks = [];
268 const resBody = Buffer.concat(chunks).toString();
294 const urlPath = await this._discoverWebsocketPath();
299 const { 0: { webSocketDebuggerUrl } } = await this._fetchJSON('/json');
306 const requestKey = crypto.randomBytes(16).toString('base64');
309 const httpReq = this._http = http.request({
332 const handshakeListener = (res, socket) => {