Changeset e29cc2e for trip-planner-front/node_modules/engine.io/README.md
- Timestamp:
- 11/25/21 22:08:24 (3 years ago)
- Branches:
- master
- Children:
- 8d391a1
- Parents:
- 59329aa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/node_modules/engine.io/README.md
r59329aa re29cc2e 2 2 # Engine.IO: the realtime engine 3 3 4 [![Build Status](https://github.com/socketio/engine.io/workflows/CI/badge.svg?branch=master) )](https://github.com/socketio/engine.io/actions)4 [![Build Status](https://github.com/socketio/engine.io/workflows/CI/badge.svg?branch=master)](https://github.com/socketio/engine.io/actions) 5 5 [![NPM version](https://badge.fury.io/js/engine.io.svg)](http://badge.fury.io/js/engine.io) 6 6 … … 189 189 const httpServer = require('http').createServer().listen(3000); 190 190 const server = engine.attach(httpServer, { 191 wsEngine: 'uws' // requires having uws as dependency191 wsEngine: require('eiows').Server // requires having eiows as dependency 192 192 }); 193 193 … … 205 205 - **Arguments** 206 206 - `Socket`: a Socket object 207 208 - `initial_headers` 209 - Fired on the first request of the connection, before writing the response headers 210 - **Arguments** 211 - `headers` (`Object`): a hash of headers 212 - `req` (`http.IncomingMessage`): the request 213 214 - `headers` 215 - Fired on the all requests of the connection, before writing the response headers 216 - **Arguments** 217 - `headers` (`Object`): a hash of headers 218 - `req` (`http.IncomingMessage`): the request 219 220 - `connection_error` 221 - Fired when an error occurs when establishing the connection. 222 - **Arguments** 223 - `error`: an object with following properties: 224 - `req` (`http.IncomingMessage`): the request that was dropped 225 - `code` (`Number`): one of `Server.errors` 226 - `message` (`string`): one of `Server.errorMessages` 227 - `context` (`Object`): extra info about the error 228 229 | Code | Message | 230 | ---- | ------- | 231 | 0 | "Transport unknown" 232 | 1 | "Session ID unknown" 233 | 2 | "Bad handshake method" 234 | 3 | "Bad request" 235 | 4 | "Forbidden" 236 | 5 | "Unsupported protocol version" 237 207 238 208 239 ##### Properties … … 223 254 - **Options** 224 255 - `pingTimeout` (`Number`): how many ms without a pong packet to 225 consider the connection closed (` 5000`)256 consider the connection closed (`20000`) 226 257 - `pingInterval` (`Number`): how many ms before sending a new ping 227 258 packet (`25000`) … … 250 281 headers. This cookie might be used for sticky-session. Defaults to not sending any cookie (`false`). 251 282 See [here](https://github.com/jshttp/cookie#options-1) for all supported options. 252 - `wsEngine` (` String`): what WebSocket server implementation to use. Specified module must conform to the `ws` interface (see [ws module api docs](https://github.com/websockets/ws/blob/master/doc/ws.md)). Default value is `ws`. An alternative c++ addon is also available by installing `uws` module.283 - `wsEngine` (`Function`): what WebSocket server implementation to use. Specified module must conform to the `ws` interface (see [ws module api docs](https://github.com/websockets/ws/blob/master/doc/ws.md)). Default value is `ws`. An alternative c++ addon is also available by installing `eiows` module. 253 284 - `cors` (`Object`): the options that will be forwarded to the cors module. See [there](https://github.com/expressjs/cors#configuration-options) for all available options. Defaults to no CORS allowed. 254 285 - `initialPacket` (`Object`): an optional packet which will be concatenated to the handshake packet emitted by Engine.IO. … … 325 356 - `type`: packet type 326 357 - `data`: packet data (if type is message) 358 - `heartbeat` 359 - Called when `ping` or `pong` packed is received (depends of client version) 327 360 328 361 ##### Properties
Note:
See TracChangeset
for help on using the changeset viewer.