node-libcurl
Version:
The fastest http(s) client (and much more) for Node.js - Node.js bindings for libcurl
80 lines • 2.84 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CurlWsOptions = exports.CurlWs = void 0;
/**
* Copyright (c) Jonathan Cardoso Machado. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// https://github.com/curl/curl/blob/master/include/curl/websockets.h
/**
* WebSocket frame flags
*
* These flags are used to identify the type of WebSocket frame and its properties.
* The frame type flags (Text, Binary, Close, Ping, Pong) are mutually exclusive.
*
* `CURLWS_TEXT` becomes `CurlWs.Text`
*
* @public
*/
var CurlWs;
(function (CurlWs) {
/**
* The frame contains text data. Note that libcurl does not verify that
* the content is valid UTF-8.
*/
CurlWs[CurlWs["Text"] = 1] = "Text";
/**
* The frame contains binary data.
*/
CurlWs[CurlWs["Binary"] = 2] = "Binary";
/**
* This is a continuation frame. It implies there is another fragment coming
* as part of the same message. Only one fragmented message can be transmitted
* at a time, but it may be interrupted by control frames (Close, Ping, Pong).
*/
CurlWs[CurlWs["Cont"] = 4] = "Cont";
/**
* This is a close frame. It may contain a 2-byte unsigned integer in network
* byte order that indicates the close reason and may additionally contain up
* to 123 bytes of further textual payload.
*/
CurlWs[CurlWs["Close"] = 8] = "Close";
/**
* This is a ping frame. It may contain up to 125 bytes of payload.
* libcurl automatically responds with a pong message unless disabled via
* WS_OPTIONS.
*/
CurlWs[CurlWs["Ping"] = 16] = "Ping";
/**
* This is a pong frame. It may contain up to 125 bytes of payload.
*/
CurlWs[CurlWs["Pong"] = 32] = "Pong";
/**
* Used when sending partial frames. The provided data is only a partial frame
* and there is more coming in a following call to wsSend().
*/
CurlWs[CurlWs["Offset"] = 64] = "Offset";
})(CurlWs || (exports.CurlWs = CurlWs = {}));
/**
* WebSocket options flags
*
* These flags are used with the WS_OPTIONS curl option.
*
* @public
*/
var CurlWsOptions;
(function (CurlWsOptions) {
/**
* Passes on the data from the network without parsing it, leaving that
* entirely to the application. This mode is intended for applications that
* already have a WebSocket parser/engine.
*/
CurlWsOptions[CurlWsOptions["RawMode"] = 1] = "RawMode";
/**
* Tells libcurl to not automatically respond to PING frames with PONG.
*/
CurlWsOptions[CurlWsOptions["NoAutoPong"] = 2] = "NoAutoPong";
})(CurlWsOptions || (exports.CurlWsOptions = CurlWsOptions = {}));
//# sourceMappingURL=CurlWs.js.map