Lines Matching refs:ws
36 * @param {import('./websocket').WebSocket} ws
40 function establishWebSocketConnection (url, protocols, ws, onEstablish, options) {
42 // scheme is "ws", and to "https" otherwise.
45 requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'
113 failWebsocketConnection(ws, 'Received network error or non-101 status code.')
122 failWebsocketConnection(ws, 'Server did not respond with sent protocols.')
137 failWebsocketConnection(ws, 'Server did not set Upgrade header to "websocket".')
146 failWebsocketConnection(ws, 'Server did not set Connection header to "upgrade".')
160 failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')
174 failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')
186 failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')
213 if (!this.ws[kByteParser].write(chunk)) {
223 const { ws } = this
228 const wasClean = ws[kSentClose] && ws[kReceivedClose]
233 const result = ws[kByteParser].closingInfo
238 } else if (!ws[kSentClose]) {
248 ws[kReadyState] = states.CLOSED
264 fireEvent('close', ws, CloseEvent, {
270 websocket: ws,
278 const { ws } = this
280 ws[kReadyState] = states.CLOSING