Template Upload
This commit is contained in:
617
node_modules/engine.io-client/History.md
generated
vendored
Normal file
617
node_modules/engine.io-client/History.md
generated
vendored
Normal file
@ -0,0 +1,617 @@
|
||||
|
||||
1.8.0 / 2016-11-20
|
||||
===================
|
||||
|
||||
* [fix] Fixed regression creating connection over https from node (#513)
|
||||
* [fix] Fixed regression creating connection over wss from node (#514)
|
||||
* [feature] Enable definition of timeouts for xhr-polling (#456)
|
||||
* [feature] Added flag forceNode to override the normal behavior of prefering Browser based implementations. (#469)
|
||||
* [feature] add localAddress option (#487)
|
||||
* [chore] update dependencies (#516)
|
||||
* [chore] Speed up lint by avoiding '**/*.js' matching pattern (#517)
|
||||
* [chore] Bump debug to version 2.3.3 (#520)
|
||||
|
||||
1.7.2 / 2016-10-24
|
||||
===================
|
||||
|
||||
* [fix] Set accept header to */* to support react app proxy (#508)
|
||||
* [fix] remove a workaround for ios (#465)
|
||||
* [fix] onPacket now emits data on 'closing' state as well (#484)
|
||||
* [fix] Obfuscate `ActiveXObject` occurrences (#509)
|
||||
* [docs] Add missing `onlyBinaryUpgrades` option in the docs (#510)
|
||||
* [chore] Add Github issue and PR templates (#511)
|
||||
|
||||
1.7.1 / 2016-10-20
|
||||
===================
|
||||
|
||||
* [fix] Define "requestsCount" var and "requests" hash unconditionally (#490)
|
||||
* [perf] Add all properties to the socket in the constructor (#488)
|
||||
* [chore] Update zuul browser settings (#504)
|
||||
* [chore] Bump engine.io-parser to 1.3.1 (#505)
|
||||
* [chore] Use more-specific imports for StealJS compatibility (#467)
|
||||
|
||||
1.7.0 / 2016-10-05
|
||||
===================
|
||||
|
||||
* [fix] Revert "default `rejectUnauthorized` to `true`" (#496)
|
||||
* [fix] Use xhr.responseText if xhr.response is not provided (#483)
|
||||
* [fix] Fix issue with errors during WebSocket creation not being caught (#475)
|
||||
* [style] Add missing semi-colon (#501)
|
||||
* [chore] Add gulp & babel in the build process (#455)
|
||||
* [chore] Add eslint (#458)
|
||||
* [chore] Bump zuul (#464)
|
||||
* [chore] Remove unused submodule (#466)
|
||||
* [chore] Bumping ws to 1.1.1 (#478)
|
||||
* [chore] Update zuul browser settings following EOL notices (#486)
|
||||
* [chore] Bump engine.io-parser (#492)
|
||||
* [chore] Make the build status badge point towards master (#497)
|
||||
* [chore] Bump zuul to 3.11.0 & zuul-ngrok to 4.0.0 (#498)
|
||||
* [chore] Restrict files included in npm package (#499)
|
||||
|
||||
1.6.11 / 2016-06-23
|
||||
===================
|
||||
|
||||
* bump version
|
||||
|
||||
1.6.10 / 2016-06-23
|
||||
===================
|
||||
|
||||
* bump version
|
||||
|
||||
1.6.9 / 2016-05-02
|
||||
==================
|
||||
|
||||
* default `rejectUnauthorized` to `true`
|
||||
|
||||
1.6.8 / 2016-01-25
|
||||
==================
|
||||
|
||||
* safely resolve `ws` module
|
||||
|
||||
1.6.7 / 2016-01-10
|
||||
==================
|
||||
|
||||
* prevent `ws` from being added to the bundle
|
||||
* added jsonp fix for when no `<script>` is found
|
||||
|
||||
1.6.6 / 2016-01-07
|
||||
==================
|
||||
|
||||
* support: add fallback to `global` for nativescript [@ligaz]
|
||||
* exclude `ws` instead of ignoring it from build [@lpinca]
|
||||
|
||||
1.6.5 / 2016-01-05
|
||||
==================
|
||||
|
||||
* package: bump `ws` for sec advisory
|
||||
|
||||
1.6.4 / 2015-12-04
|
||||
==================
|
||||
|
||||
* ipv6 url support
|
||||
* README: fix the description of the `timestampRequests` option
|
||||
* transports: use `yeast` to generate the cache busting id
|
||||
* fix arraybuffer > base64 for binary sends
|
||||
|
||||
1.6.3 / 2015-12-01
|
||||
==================
|
||||
|
||||
* remove compress option from control packets
|
||||
* threshold for permessage-deflate
|
||||
|
||||
1.6.2 / 2015-11-30
|
||||
==================
|
||||
|
||||
* package: bump `ws` for memory fix with compression
|
||||
* fix response parsing error for polling (unused)
|
||||
|
||||
1.6.1 / 2015-11-28
|
||||
==================
|
||||
|
||||
* fix packet options that `ws` changes [Nibbler999]
|
||||
* package: use published `engine.io-parser`
|
||||
|
||||
1.6.0 / 2015-11-28
|
||||
==================
|
||||
|
||||
* test with travis containers
|
||||
* socket: remove duplicate declaration (fixes #434)
|
||||
* package: bump `debug` (fixes #433)
|
||||
* bump zuul and zuul-ngrok
|
||||
* package: fix repository url
|
||||
* bump `ws` for several improvements
|
||||
* fix rejectUnauthorized bug
|
||||
* websocket: improve firing of `drain` in websocket transport
|
||||
* socket: clean up buffers right after `close` event
|
||||
* change semantics of the write callback for polling
|
||||
(fire upon flush instead drain)
|
||||
* socket: fix host parsing for IPv6 URLs
|
||||
* socket: handle parser errors appropriately
|
||||
* expose `ping` and `pong` events
|
||||
* enable `supportsBinary` when running as a node client
|
||||
* introduce `extraHeaders` support
|
||||
* fix error when passing `WebSocket#send` second argument on Safari
|
||||
* support compression
|
||||
|
||||
1.5.4 / 2015-09-09
|
||||
==================
|
||||
|
||||
* package: bump `engine.io-parser`
|
||||
|
||||
1.5.3 / 2015-09-09
|
||||
==================
|
||||
|
||||
* package: bump `ws` to fix node 0.4.0
|
||||
|
||||
1.5.2 / 2015-07-09
|
||||
==================
|
||||
|
||||
* package: bump `ws` to fix windows build issues
|
||||
|
||||
1.5.1 / 2015-01-19
|
||||
==================
|
||||
|
||||
* do not rely on `git(1)` for dep, point to tarball instead
|
||||
|
||||
1.5.0 / 2015-01-18
|
||||
==================
|
||||
|
||||
* package: bump `engine.io-parser`
|
||||
* fix IE tests firing too many connections [rase-]
|
||||
* fix default port detection when host is specified [defunctzombie]
|
||||
* add support for custom SSL options in constructor [rase-]
|
||||
* only call xhr.abort() on error cases in `polling-xhr` [samcday]
|
||||
|
||||
1.4.3 / 2014-11-21
|
||||
==================
|
||||
|
||||
* support: make the build system work with the latest browserify
|
||||
* test: remove test with partial browser support
|
||||
* Fixed calls to addEventListener in old browsers
|
||||
|
||||
1.4.2 / 2014-10-27
|
||||
==================
|
||||
|
||||
* remove invalid value for strict mode
|
||||
* IE10 should prefer using XHR2 over XDR because it's safer
|
||||
* fixed transport close deferring logic [nkzawa]
|
||||
* wait for buffer to be drained before closing [nkzawa]
|
||||
|
||||
1.4.1 / 2014-10-03
|
||||
==================
|
||||
|
||||
* Fixed "jsonp polling iframe removal error"
|
||||
* Move ws upgrade needing connection tests to a block checking browser support.
|
||||
* check `readyState` in `sendPacket` and close on `upgradeError` too
|
||||
* defer close while upgrading a transport
|
||||
|
||||
1.4.0 / 2014-09-03
|
||||
==================
|
||||
|
||||
* add matrix support for travis runs.
|
||||
* add `enablesXDR` option to turn on `XDomainRequest`
|
||||
* package: bump `browserify`
|
||||
* package: bump `engine.io-parser`
|
||||
* style and close socket after assert
|
||||
* add support for `jsonp` option to turn it off
|
||||
|
||||
1.3.1 / 2014-06-19
|
||||
==================
|
||||
|
||||
* transport: catch utf8 decode errors
|
||||
|
||||
1.3.0 / 2014-06-13
|
||||
==================
|
||||
|
||||
* smaller inherits utility
|
||||
* fix a test for ws
|
||||
* upgrade emitter dep to not rely on tarball
|
||||
|
||||
1.2.2 / 2014-05-30
|
||||
==================
|
||||
|
||||
* package: bump `engine.io-parser` for binary utf8 fix
|
||||
|
||||
1.2.1 / 2014-05-22
|
||||
==================
|
||||
|
||||
* build
|
||||
|
||||
1.2.0 / 2014-05-18
|
||||
==================
|
||||
|
||||
* removed flashsocket, moving to userland
|
||||
* new build
|
||||
|
||||
1.1.1 / 2014-05-14
|
||||
==================
|
||||
|
||||
* jsonp-polling: fixed newline double escaping
|
||||
* package: bump parser
|
||||
* remove legacy Socket#onopen call
|
||||
* added tests for multibyte strings
|
||||
|
||||
1.1.0 / 2014-04-27
|
||||
==================
|
||||
|
||||
* bump zuul version
|
||||
* renamed removeAllListeners to cleanup
|
||||
* use inherits package instead of inherit
|
||||
* removed all references to util.js
|
||||
* fix if statement in FlashWS.ready method
|
||||
* polling-jsonp: prevent spurious errors from being emitted when the window is unloaded
|
||||
* polling-xhr: fix a comment and remove unneeded `document` reference
|
||||
* enforce cache busting for all user agents
|
||||
* JSONP and test fixes for fails in IE
|
||||
* package: bump `engine.io-parser`
|
||||
* polling-xhr: abort the request when the window is unloaded
|
||||
|
||||
1.0.5 / 2014-03-18
|
||||
==================
|
||||
|
||||
* package: bump `engine.io-parser` for android binary fix
|
||||
|
||||
1.0.4 / 2014-03-14
|
||||
==================
|
||||
|
||||
* no base64 encoding for no reason when using websockets
|
||||
|
||||
1.0.3 / 2014-03-12
|
||||
==================
|
||||
|
||||
* fix browserify
|
||||
|
||||
1.0.2 / 2014-03-12
|
||||
==================
|
||||
|
||||
* bump `engine.io-parser`
|
||||
* made `parseJSON` and `parseURI` from `util` their own modules [gkoren]
|
||||
* clean up tests
|
||||
* clean up browserify
|
||||
|
||||
1.0.1 / 2014-03-06
|
||||
==================
|
||||
|
||||
* package: bump `engine.io-parser`
|
||||
|
||||
1.0.0 / 2014-03-06
|
||||
==================
|
||||
|
||||
* run browserify without shims
|
||||
* emit socket upgrade event after upgrade done
|
||||
* better feature detection for XHR2
|
||||
* added `rememberUpgrade` option
|
||||
* binary support
|
||||
|
||||
0.9.0 / 2014-02-09
|
||||
==================
|
||||
|
||||
* Fix simple `host:port` URLs and IPV6 [bmalehorn]
|
||||
* Fix XHR cleanup method [poohlty]
|
||||
* Match semantics of `close` event with `WebSocket`. If an error occurs
|
||||
and `open` hadn't fired before, we still emit `close` as per
|
||||
WebSocket spec [mokesmokes].
|
||||
* Removed SPEC (now in `engine.io-protocol` repository)
|
||||
* Remove `Socket#open` docs (private API) [mokesmokes]
|
||||
|
||||
0.8.2 / 2014-01-18
|
||||
==================
|
||||
|
||||
* polling-xhr: avoid catching user-thrown errors
|
||||
* util: remove unused `hasCORS`
|
||||
* polling: remove deferring for faster startup (fixes #174)
|
||||
* engine now works perfectly on workers
|
||||
|
||||
0.8.1 / 2014-01-17
|
||||
==================
|
||||
|
||||
* package: bump debug to fix `localStorage` issue (fixes #213)
|
||||
* remove duplicate xmlhttprequest code
|
||||
* add iphone automated testing
|
||||
* bump zuul to 1.3.0 to improve tests performance
|
||||
* use invalid ip address for incorrect connection test
|
||||
* Fix GH-224, remove sockets array
|
||||
|
||||
0.8.0 / 2014-01-05
|
||||
==================
|
||||
|
||||
* socket: emit upgrade errors as `upgradeError` instead of `error`
|
||||
|
||||
0.7.14 / 2014-01-01
|
||||
===================
|
||||
|
||||
* test: increase timeouts for network tests
|
||||
* test: whitelist globals
|
||||
* test: improve socket closing test
|
||||
* polling: improve url timestamp for ie11 and allow force disabling
|
||||
* polling-xhr: handle errors for xhr creation (fixes `access denied` issues)
|
||||
* polling-xhr: style
|
||||
* socket: more instrumentation for transport creation
|
||||
* socket: allow explicit `false` for `timestampRequests`
|
||||
* socket: accept `null` as first argument
|
||||
* Makefile: cleanup
|
||||
* .travis: deprecate 0.6
|
||||
|
||||
0.7.13 / 2013-12-20
|
||||
===================
|
||||
|
||||
* use `jsonp` in favor of `XDomainRequest` to preserve `Cookie`
|
||||
headers in all situations [3rd-eden] (fixes #217)
|
||||
* run zuul tests after node tests [defunctzombie]
|
||||
* add zuul support for easier browser testing [defunctzombie]
|
||||
|
||||
0.7.12 / 2013-11-11
|
||||
===================
|
||||
|
||||
* engine.io: updated build to fix WebSocket constructor issue
|
||||
* package: move browserify into devDeps
|
||||
|
||||
0.7.11 / 2013-11-06
|
||||
===================
|
||||
|
||||
* AMD support
|
||||
* Makefile: build now smaller thanks to browserify
|
||||
* add browserify support
|
||||
|
||||
0.7.10 / 2013-10-28
|
||||
===================
|
||||
|
||||
* fixed issue which prevented IE9 and under to pass Cookies to server during handshake
|
||||
* package: update "ws" to v0.4.31
|
||||
* fixed - there is no host property only hostname
|
||||
* fixed - flash socket creation
|
||||
* fixed - emit errors thrown by xhr.send()
|
||||
|
||||
0.7.9 / 2013-08-30
|
||||
==================
|
||||
|
||||
* websocket: pass `undefined` as the WebSocket "protocols"
|
||||
|
||||
0.7.8 / 2013-08-30
|
||||
==================
|
||||
|
||||
* package: update "ws"
|
||||
|
||||
0.7.7 / 2013-08-30
|
||||
==================
|
||||
|
||||
* package: bump ws to 0.4.30
|
||||
* websocket: no more env sniffing, just require `ws` [TooTallNate]
|
||||
* websocket: remove the "bufferedAmount" checking logic [TooTallNate]
|
||||
|
||||
0.7.6 / 2013-08-30
|
||||
==================
|
||||
|
||||
* package: revert ws to avoid upgrade fail now
|
||||
|
||||
0.7.5 / 2013-08-30
|
||||
==================
|
||||
|
||||
* package: bump ws to 0.4.30
|
||||
|
||||
0.7.4 / 2013-08-25
|
||||
==================
|
||||
|
||||
* package: rolling back to `ws` `0.4.25` due to disconnection bug
|
||||
|
||||
0.7.3 / 2013-08-23
|
||||
==================
|
||||
|
||||
* noop bump
|
||||
|
||||
0.7.2 / 2013-08-23
|
||||
==================
|
||||
|
||||
* transports: fix WebSocket transport in the web browser (again)
|
||||
|
||||
0.7.1 / 2013-08-23
|
||||
==================
|
||||
|
||||
* transports: fix WebSocket transport in the web browser
|
||||
* package: upgrade "ws" to v0.4.29
|
||||
|
||||
0.7.0 / 2013-08-23
|
||||
==================
|
||||
|
||||
* socket: add `agent` option
|
||||
* package: point "xmlhttprequest" to our LearnBoost fork for agent support
|
||||
* package: specify a newer version of "ws" that includes `agent` support
|
||||
* util: use "component/has-cors"
|
||||
* transport: fix whitespace
|
||||
* util: use "component/global"
|
||||
* package: Add repository field to readme
|
||||
* socket: Don't lose packets writen during upgrade after a re-open
|
||||
* socket: use a consistent "debug" name for socket.js
|
||||
* package: Update emitter dep to 1.0.1 for old IE support
|
||||
|
||||
0.6.3 / 2013-06-21
|
||||
==================
|
||||
|
||||
* fix check readyState in polling transport (Naoyuki Kanezawa)
|
||||
* use http url in npm dependencies for emitter (Eric Schoffstall)
|
||||
|
||||
0.6.2 / 2013-06-15
|
||||
==================
|
||||
|
||||
* transports: improve polling orderly close (fixes #164)
|
||||
* socket: ignore further transport communication upon `onClose`
|
||||
* socket: added missing `socket#onerror` support
|
||||
* socket: don't call `socket#onclose` if previous state was not `open`
|
||||
* transports: fix iOS5 crash issue
|
||||
* Makefile: extra precaution when building to avoid 0.6.0 build problem
|
||||
|
||||
0.6.1 / 2013-06-06
|
||||
==================
|
||||
|
||||
* engine.io: fixed build
|
||||
|
||||
0.6.0 / 2013-05-31
|
||||
==================
|
||||
|
||||
* does not emit close on incorrect socket connection
|
||||
* use indexof component for ie8 and below
|
||||
* improved x-domain handling
|
||||
* introduce public `ping` api
|
||||
* added drain event
|
||||
* fix `flush` and `flushComplete` events
|
||||
* fixed `drain` bug splicing with upgrading
|
||||
* add support for callbacks with socket.send()
|
||||
|
||||
0.5.0 / 2013-03-16
|
||||
==================
|
||||
|
||||
* socket: implement qs support for `string`
|
||||
* added query.EIO to take protocol version from parser
|
||||
* use istanbul for code coverage
|
||||
* integrated engine.io-protocol 0.3.0
|
||||
* updated ws
|
||||
* fixed JSONPPolling iframe removal error
|
||||
* changed error message to match xhr error message on jsonp transport script tag
|
||||
* Added onerror handler for script tag in jsonp transport
|
||||
* remove uid qs
|
||||
* Added missing colon in payload. Thanks @lsm
|
||||
|
||||
0.4.3 / 2013-02-08
|
||||
==================
|
||||
|
||||
* package: removed unusued `parser.js`
|
||||
|
||||
0.4.2 / 2013-02-08
|
||||
==================
|
||||
|
||||
* polling-jsonp: fix ie6 JSONP on SSL
|
||||
* close also if socket.readyState is on "opening"
|
||||
* parser.js: removed the file package.json: added the engine.io-parser dependency everything else: switched to engine.io-parser
|
||||
* fix "TypeError: Object #<Object> has no method 'global'"
|
||||
* client now ignores unsupported upgrades
|
||||
|
||||
0.4.1 / 2013-01-18
|
||||
==================
|
||||
|
||||
* do not shadow global XMLHttpRequest
|
||||
* socket: added `data` event (as synonym to `message`)
|
||||
* socket: remove `resource` and fix `path`
|
||||
* socket: fixed access to `opts`
|
||||
* test: fixed transports tests
|
||||
* socket: constructor can accept uri/opts simultaneously
|
||||
* SPEC: simplified: removed resource from SPEC
|
||||
* socket: proper `host`/`hostname` support
|
||||
* socket: ensure `onclose` idempotency
|
||||
* socket: added `onerror` instrumentation
|
||||
* socket: fix style
|
||||
* use window to detect platform and fix global reference
|
||||
* *: fix references to `global` (fixes #79)
|
||||
|
||||
0.4.0 / 2012-12-09
|
||||
==================
|
||||
|
||||
* *: now based on `component(1)`
|
||||
* *: module now exports `Socket`
|
||||
* socket: export constructors, utils and `protocol`
|
||||
* *: implemented `emitter` component
|
||||
* *: removed browserbuild and preprocessor instructions
|
||||
|
||||
0.3.10 / 2012-12-03
|
||||
===================
|
||||
|
||||
* socket: fix closing the socket in an `open` listener [mmastrac]
|
||||
* socket: perform ping interval/timer cleanup [mmastrac]
|
||||
* fix SPEC (packages -> packets) [jxck]
|
||||
* socket: handle probe's transport errors [indutny]
|
||||
|
||||
0.3.9 / 2012-10-23
|
||||
==================
|
||||
|
||||
* socket: fix `hostname` instead of `host`
|
||||
* socket: avoid duplicate `port` defaults
|
||||
|
||||
0.3.8 / 2012-10-23
|
||||
==================
|
||||
|
||||
* socket: introduce introspection hooks
|
||||
* socket: introduced `host` and `port` `location` defaults
|
||||
* flashsocket: obfuscate activex (fixes #31)
|
||||
* README: documented reconnect (closes #45)
|
||||
* socket: unset `id` upon close
|
||||
* socket: clear transport listeners upon force close
|
||||
|
||||
0.3.7 / 2012-10-21
|
||||
==================
|
||||
|
||||
* fix `version` [quackingduck]
|
||||
* ping timeout gets reset upon any packet received [indutny]
|
||||
* timeout fixes [cadorn, indutny]
|
||||
* transport: fix xdomain detection in absence of location.port (GH-38)
|
||||
* socket: fix passing `false` as secure getting overridden
|
||||
* socket: default `secure` to `true` for SSL-served pages
|
||||
* socket: fix default port for SSL when `secure` is not supplied
|
||||
|
||||
0.3.6 / 2012-10-16
|
||||
==================
|
||||
|
||||
* socket: reset timeout on any incoming data [indutny]
|
||||
|
||||
0.3.5 / 2012-10-14
|
||||
==================
|
||||
|
||||
* new build
|
||||
|
||||
0.3.4 / 2012-10-14
|
||||
==================
|
||||
|
||||
* package: fix `component` exports
|
||||
|
||||
0.3.3 / 2012-10-10
|
||||
==================
|
||||
|
||||
* socket: fix `secure` default value discovery [quackingduck]
|
||||
|
||||
0.3.2 / 2012-10-08
|
||||
==================
|
||||
|
||||
* Bump
|
||||
|
||||
0.3.1 / 2012-10-08
|
||||
==================
|
||||
|
||||
* socket: added `write` alias for `send`
|
||||
* package: added `component`
|
||||
|
||||
0.3.0 / 2012-09-04
|
||||
==================
|
||||
|
||||
* IE's XDomainRequest cannot do requests that go from HTTPS to HTTP or HTTP to HTTPS [mixu]
|
||||
* Switch to client-initiated ping, and set interval in handshake [cadorn]
|
||||
|
||||
0.2.2 / 2012-08-26
|
||||
==================
|
||||
|
||||
* polling-jsonp: allow unneeded global leak (fixes #41)
|
||||
* polling-jsonp: allow for multiple eio's in the same page
|
||||
|
||||
0.2.1 / 2012-08-13
|
||||
==================
|
||||
|
||||
* Bump
|
||||
|
||||
0.2.0 / 2012-08-06
|
||||
==================
|
||||
|
||||
* polling: introduced `poll` and `pollComplete` (formerly `poll`) events
|
||||
|
||||
0.1.2 / 2012-08-02
|
||||
==================
|
||||
|
||||
* Bump
|
||||
|
||||
0.1.1 / 2012-08-01
|
||||
==================
|
||||
|
||||
* Added options for request timestamping
|
||||
* Made timestamp query param customizable
|
||||
* Added automatic timestamping for Android
|
||||
|
||||
0.1.0 / 2012-07-03
|
||||
==================
|
||||
|
||||
* Initial release.
|
22
node_modules/engine.io-client/LICENSE
generated
vendored
Normal file
22
node_modules/engine.io-client/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014-2015 Automattic <dev@cloudup.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
295
node_modules/engine.io-client/README.md
generated
vendored
Normal file
295
node_modules/engine.io-client/README.md
generated
vendored
Normal file
@ -0,0 +1,295 @@
|
||||
|
||||
# Engine.IO client
|
||||
|
||||
[](http://travis-ci.org/socketio/engine.io-client)
|
||||
[](http://badge.fury.io/js/engine.io-client)
|
||||
|
||||
This is the client for [Engine.IO](http://github.com/socketio/engine.io),
|
||||
the implementation of transport-based cross-browser/cross-device
|
||||
bi-directional communication layer for [Socket.IO](http://github.com/socketio/socket.io).
|
||||
|
||||
## How to use
|
||||
|
||||
### Standalone
|
||||
|
||||
You can find an `engine.io.js` file in this repository, which is a
|
||||
standalone build you can use as follows:
|
||||
|
||||
```html
|
||||
<script src="/path/to/engine.io.js"></script>
|
||||
<script>
|
||||
// eio = Socket
|
||||
var socket = eio('ws://localhost');
|
||||
socket.on('open', function(){
|
||||
socket.on('message', function(data){});
|
||||
socket.on('close', function(){});
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
### With browserify
|
||||
|
||||
Engine.IO is a commonjs module, which means you can include it by using
|
||||
`require` on the browser and package using [browserify](http://browserify.org/):
|
||||
|
||||
1. install the client package
|
||||
|
||||
```bash
|
||||
$ npm install engine.io-client
|
||||
```
|
||||
|
||||
1. write your app code
|
||||
|
||||
```js
|
||||
var socket = require('engine.io-client')('ws://localhost');
|
||||
socket.on('open', function(){
|
||||
socket.on('message', function(data){});
|
||||
socket.on('close', function(){});
|
||||
});
|
||||
```
|
||||
|
||||
1. build your app bundle
|
||||
|
||||
```bash
|
||||
$ browserify app.js > bundle.js
|
||||
```
|
||||
|
||||
1. include on your page
|
||||
|
||||
```html
|
||||
<script src="/path/to/bundle.js"></script>
|
||||
```
|
||||
|
||||
### Sending and receiving binary
|
||||
|
||||
```html
|
||||
<script src="/path/to/engine.io.js"></script>
|
||||
<script>
|
||||
var socket = new eio.Socket('ws://localhost/');
|
||||
socket.binaryType = 'blob';
|
||||
socket.on('open', function () {
|
||||
socket.send(new Int8Array(5));
|
||||
socket.on('message', function(blob){});
|
||||
socket.on('close', function(){ });
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
### Node.JS
|
||||
|
||||
Add `engine.io-client` to your `package.json` and then:
|
||||
|
||||
```js
|
||||
var socket = require('engine.io-client')('ws://localhost');
|
||||
socket.on('open', function(){
|
||||
socket.on('message', function(data){});
|
||||
socket.on('close', function(){});
|
||||
});
|
||||
```
|
||||
|
||||
### Node.js with certificates
|
||||
```js
|
||||
var opts = {
|
||||
key: fs.readFileSync('test/fixtures/client.key'),
|
||||
cert: fs.readFileSync('test/fixtures/client.crt'),
|
||||
ca: fs.readFileSync('test/fixtures/ca.crt')
|
||||
};
|
||||
|
||||
var socket = require('engine.io-client')('ws://localhost', opts);
|
||||
socket.on('open', function(){
|
||||
socket.on('message', function(data){});
|
||||
socket.on('close', function(){});
|
||||
});
|
||||
```
|
||||
|
||||
### Node.js with extraHeaders
|
||||
```js
|
||||
var opts = {
|
||||
extraHeaders: {
|
||||
'X-Custom-Header-For-My-Project': 'my-secret-access-token',
|
||||
'Cookie': 'user_session=NI2JlCKF90aE0sJZD9ZzujtdsUqNYSBYxzlTsvdSUe35ZzdtVRGqYFr0kdGxbfc5gUOkR9RGp20GVKza; path=/; expires=Tue, 07-Apr-2015 18:18:08 GMT; secure; HttpOnly'
|
||||
}
|
||||
};
|
||||
|
||||
var socket = require('engine.io-client')('ws://localhost', opts);
|
||||
socket.on('open', function(){
|
||||
socket.on('message', function(data){});
|
||||
socket.on('close', function(){});
|
||||
});
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
- Lightweight
|
||||
- Runs on browser and node.js seamlessly
|
||||
- Transports are independent of `Engine`
|
||||
- Easy to debug
|
||||
- Easy to unit test
|
||||
- Runs inside HTML5 WebWorker
|
||||
- Can send and receive binary data
|
||||
- Receives as ArrayBuffer or Blob when in browser, and Buffer or ArrayBuffer
|
||||
in Node
|
||||
- When XHR2 or WebSockets are used, binary is emitted directly. Otherwise
|
||||
binary is encoded into base64 strings, and decoded when binary types are
|
||||
supported.
|
||||
- With browsers that don't support ArrayBuffer, an object { base64: true,
|
||||
data: dataAsBase64String } is emitted on the `message` event.
|
||||
|
||||
## API
|
||||
|
||||
### Socket
|
||||
|
||||
The client class. Mixes in [Emitter](http://github.com/component/emitter).
|
||||
Exposed as `eio` in the browser standalone build.
|
||||
|
||||
#### Properties
|
||||
|
||||
- `protocol` _(Number)_: protocol revision number
|
||||
- `binaryType` _(String)_ : can be set to 'arraybuffer' or 'blob' in browsers,
|
||||
and `buffer` or `arraybuffer` in Node. Blob is only used in browser if it's
|
||||
supported.
|
||||
|
||||
#### Events
|
||||
|
||||
- `open`
|
||||
- Fired upon successful connection.
|
||||
- `message`
|
||||
- Fired when data is received from the server.
|
||||
- **Arguments**
|
||||
- `String` | `ArrayBuffer`: utf-8 encoded data or ArrayBuffer containing
|
||||
binary data
|
||||
- `close`
|
||||
- Fired upon disconnection. In compliance with the WebSocket API spec, this event may be
|
||||
fired even if the `open` event does not occur (i.e. due to connection error or `close()`).
|
||||
- `error`
|
||||
- Fired when an error occurs.
|
||||
- `flush`
|
||||
- Fired upon completing a buffer flush
|
||||
- `drain`
|
||||
- Fired after `drain` event of transport if writeBuffer is empty
|
||||
- `upgradeError`
|
||||
- Fired if an error occurs with a transport we're trying to upgrade to.
|
||||
- `upgrade`
|
||||
- Fired upon upgrade success, after the new transport is set
|
||||
- `ping`
|
||||
- Fired upon _flushing_ a ping packet (ie: actual packet write out)
|
||||
- `pong`
|
||||
- Fired upon receiving a pong packet.
|
||||
|
||||
#### Methods
|
||||
|
||||
- **constructor**
|
||||
- Initializes the client
|
||||
- **Parameters**
|
||||
- `String` uri
|
||||
- `Object`: optional, options object
|
||||
- **Options**
|
||||
- `agent` (`http.Agent`): `http.Agent` to use, defaults to `false` (NodeJS only)
|
||||
- `upgrade` (`Boolean`): defaults to true, whether the client should try
|
||||
to upgrade the transport from long-polling to something better.
|
||||
- `forceJSONP` (`Boolean`): forces JSONP for polling transport.
|
||||
- `jsonp` (`Boolean`): determines whether to use JSONP when
|
||||
necessary for polling. If disabled (by settings to false) an error will
|
||||
be emitted (saying "No transports available") if no other transports
|
||||
are available. If another transport is available for opening a
|
||||
connection (e.g. WebSocket) that transport
|
||||
will be used instead.
|
||||
- `forceBase64` (`Boolean`): forces base 64 encoding for polling transport even when XHR2 responseType is available and WebSocket even if the used standard supports binary.
|
||||
- `enablesXDR` (`Boolean`): enables XDomainRequest for IE8 to avoid loading bar flashing with click sound. default to `false` because XDomainRequest has a flaw of not sending cookie.
|
||||
- `timestampRequests` (`Boolean`): whether to add the timestamp with each
|
||||
transport request. Note: polling requests are always stamped unless this
|
||||
option is explicitly set to `false` (`false`)
|
||||
- `timestampParam` (`String`): timestamp parameter (`t`)
|
||||
- `policyPort` (`Number`): port the policy server listens on (`843`)
|
||||
- `path` (`String`): path to connect to, default is `/engine.io`
|
||||
- `transports` (`Array`): a list of transports to try (in order).
|
||||
Defaults to `['polling', 'websocket']`. `Engine`
|
||||
always attempts to connect directly with the first one, provided the
|
||||
feature detection test for it passes.
|
||||
- `rememberUpgrade` (`Boolean`): defaults to false.
|
||||
If true and if the previous websocket connection to the server succeeded,
|
||||
the connection attempt will bypass the normal upgrade process and will initially
|
||||
try websocket. A connection attempt following a transport error will use the
|
||||
normal upgrade process. It is recommended you turn this on only when using
|
||||
SSL/TLS connections, or if you know that your network does not block websockets.
|
||||
- `pfx` (`String`): Certificate, Private key and CA certificates to use for SSL. Can be used in Node.js client environment to manually specify certificate information.
|
||||
- `key` (`String`): Private key to use for SSL. Can be used in Node.js client environment to manually specify certificate information.
|
||||
- `passphrase` (`String`): A string of passphrase for the private key or pfx. Can be used in Node.js client environment to manually specify certificate information.
|
||||
- `cert` (`String`): Public x509 certificate to use. Can be used in Node.js client environment to manually specify certificate information.
|
||||
- `ca` (`String`|`Array`): An authority certificate or array of authority certificates to check the remote host against.. Can be used in Node.js client environment to manually specify certificate information.
|
||||
- `ciphers` (`String`): A string describing the ciphers to use or exclude. Consult the [cipher format list](http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT) for details on the format. Can be used in Node.js client environment to manually specify certificate information.
|
||||
- `rejectUnauthorized` (`Boolean`): If true, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if verification fails. Verification happens at the connection level, before the HTTP request is sent. Can be used in Node.js client environment to manually specify certificate information.
|
||||
- `perMessageDeflate` (`Object|Boolean`): parameters of the WebSocket permessage-deflate extension
|
||||
(see [ws module](https://github.com/einaros/ws) api docs). Set to `false` to disable. (`true`)
|
||||
- `threshold` (`Number`): data is compressed only if the byte size is above this value. This option is ignored on the browser. (`1024`)
|
||||
- `extraHeaders` (`Object`): Headers that will be passed for each request to the server (via xhr-polling and via websockets). These values then can be used during handshake or for special proxies. Can only be used in Node.js client environment.
|
||||
- `onlyBinaryUpgrades` (`Boolean`): whether transport upgrades should be restricted to transports supporting binary data (`false`)
|
||||
- `requestTimeout` (`Number`): Timeout for xhr-polling requests in milliseconds (`0`)
|
||||
- `forceNode` (`Boolean`): Uses NodeJS implementation for websockets - even if there is a native Browser-Websocket available, which is preferred by default over the NodeJS implementation. (This is useful when using hybrid platforms like nw.js or electron) (`false`, NodeJS only)
|
||||
- `localAddress` (`String`): the local IP address to connect to
|
||||
- `send`
|
||||
- Sends a message to the server
|
||||
- **Parameters**
|
||||
- `String` | `ArrayBuffer` | `ArrayBufferView` | `Blob`: data to send
|
||||
- `Object`: optional, options object
|
||||
- `Function`: optional, callback upon `drain`
|
||||
- **Options**
|
||||
- `compress` (`Boolean`): whether to compress sending data. This option is ignored and forced to be `true` on the browser. (`true`)
|
||||
- `close`
|
||||
- Disconnects the client.
|
||||
|
||||
### Transport
|
||||
|
||||
The transport class. Private. _Inherits from EventEmitter_.
|
||||
|
||||
#### Events
|
||||
|
||||
- `poll`: emitted by polling transports upon starting a new request
|
||||
- `pollComplete`: emitted by polling transports upon completing a request
|
||||
- `drain`: emitted by polling transports upon a buffer drain
|
||||
|
||||
## Tests
|
||||
|
||||
`engine.io-client` is used to test
|
||||
[engine](http://github.com/socketio/engine.io). Running the `engine.io`
|
||||
test suite ensures the client works and vice-versa.
|
||||
|
||||
Browser tests are run using [zuul](https://github.com/defunctzombie/zuul). You can
|
||||
run the tests locally using the following command.
|
||||
|
||||
```
|
||||
./node_modules/.bin/zuul --local 8080 -- test/index.js
|
||||
```
|
||||
|
||||
Additionally, `engine.io-client` has a standalone test suite you can run
|
||||
with `make test` which will run node.js and browser tests. You must have zuul setup with
|
||||
a saucelabs account.
|
||||
|
||||
## Support
|
||||
|
||||
The support channels for `engine.io-client` are the same as `socket.io`:
|
||||
- irc.freenode.net **#socket.io**
|
||||
- [Google Groups](http://groups.google.com/group/socket_io)
|
||||
- [Website](http://socket.io)
|
||||
|
||||
## Development
|
||||
|
||||
To contribute patches, run tests or benchmarks, make sure to clone the
|
||||
repository:
|
||||
|
||||
```bash
|
||||
git clone git://github.com/socketio/engine.io-client.git
|
||||
```
|
||||
|
||||
Then:
|
||||
|
||||
```bash
|
||||
cd engine.io-client
|
||||
npm install
|
||||
```
|
||||
|
||||
See the `Tests` section above for how to run tests before submitting any patches.
|
||||
|
||||
## License
|
||||
|
||||
MIT - Copyright (c) 2014 Automattic, Inc.
|
4418
node_modules/engine.io-client/engine.io.js
generated
vendored
Normal file
4418
node_modules/engine.io-client/engine.io.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
node_modules/engine.io-client/index.js
generated
vendored
Normal file
2
node_modules/engine.io-client/index.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
module.exports = require('./lib/index');
|
10
node_modules/engine.io-client/lib/index.js
generated
vendored
Normal file
10
node_modules/engine.io-client/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
module.exports = require('./socket');
|
||||
|
||||
/**
|
||||
* Exports parser
|
||||
*
|
||||
* @api public
|
||||
*
|
||||
*/
|
||||
module.exports.parser = require('engine.io-parser');
|
738
node_modules/engine.io-client/lib/socket.js
generated
vendored
Normal file
738
node_modules/engine.io-client/lib/socket.js
generated
vendored
Normal file
@ -0,0 +1,738 @@
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var transports = require('./transports/index');
|
||||
var Emitter = require('component-emitter');
|
||||
var debug = require('debug')('engine.io-client:socket');
|
||||
var index = require('indexof');
|
||||
var parser = require('engine.io-parser');
|
||||
var parseuri = require('parseuri');
|
||||
var parsejson = require('parsejson');
|
||||
var parseqs = require('parseqs');
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = Socket;
|
||||
|
||||
/**
|
||||
* Socket constructor.
|
||||
*
|
||||
* @param {String|Object} uri or options
|
||||
* @param {Object} options
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function Socket (uri, opts) {
|
||||
if (!(this instanceof Socket)) return new Socket(uri, opts);
|
||||
|
||||
opts = opts || {};
|
||||
|
||||
if (uri && 'object' === typeof uri) {
|
||||
opts = uri;
|
||||
uri = null;
|
||||
}
|
||||
|
||||
if (uri) {
|
||||
uri = parseuri(uri);
|
||||
opts.hostname = uri.host;
|
||||
opts.secure = uri.protocol === 'https' || uri.protocol === 'wss';
|
||||
opts.port = uri.port;
|
||||
if (uri.query) opts.query = uri.query;
|
||||
} else if (opts.host) {
|
||||
opts.hostname = parseuri(opts.host).host;
|
||||
}
|
||||
|
||||
this.secure = null != opts.secure ? opts.secure
|
||||
: (global.location && 'https:' === location.protocol);
|
||||
|
||||
if (opts.hostname && !opts.port) {
|
||||
// if no port is specified manually, use the protocol default
|
||||
opts.port = this.secure ? '443' : '80';
|
||||
}
|
||||
|
||||
this.agent = opts.agent || false;
|
||||
this.hostname = opts.hostname ||
|
||||
(global.location ? location.hostname : 'localhost');
|
||||
this.port = opts.port || (global.location && location.port
|
||||
? location.port
|
||||
: (this.secure ? 443 : 80));
|
||||
this.query = opts.query || {};
|
||||
if ('string' === typeof this.query) this.query = parseqs.decode(this.query);
|
||||
this.upgrade = false !== opts.upgrade;
|
||||
this.path = (opts.path || '/engine.io').replace(/\/$/, '') + '/';
|
||||
this.forceJSONP = !!opts.forceJSONP;
|
||||
this.jsonp = false !== opts.jsonp;
|
||||
this.forceBase64 = !!opts.forceBase64;
|
||||
this.enablesXDR = !!opts.enablesXDR;
|
||||
this.timestampParam = opts.timestampParam || 't';
|
||||
this.timestampRequests = opts.timestampRequests;
|
||||
this.transports = opts.transports || ['polling', 'websocket'];
|
||||
this.readyState = '';
|
||||
this.writeBuffer = [];
|
||||
this.prevBufferLen = 0;
|
||||
this.policyPort = opts.policyPort || 843;
|
||||
this.rememberUpgrade = opts.rememberUpgrade || false;
|
||||
this.binaryType = null;
|
||||
this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;
|
||||
this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || {}) : false;
|
||||
|
||||
if (true === this.perMessageDeflate) this.perMessageDeflate = {};
|
||||
if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {
|
||||
this.perMessageDeflate.threshold = 1024;
|
||||
}
|
||||
|
||||
// SSL options for Node.js client
|
||||
this.pfx = opts.pfx || null;
|
||||
this.key = opts.key || null;
|
||||
this.passphrase = opts.passphrase || null;
|
||||
this.cert = opts.cert || null;
|
||||
this.ca = opts.ca || null;
|
||||
this.ciphers = opts.ciphers || null;
|
||||
this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? null : opts.rejectUnauthorized;
|
||||
this.forceNode = !!opts.forceNode;
|
||||
|
||||
// other options for Node.js client
|
||||
var freeGlobal = typeof global === 'object' && global;
|
||||
if (freeGlobal.global === freeGlobal) {
|
||||
if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {
|
||||
this.extraHeaders = opts.extraHeaders;
|
||||
}
|
||||
|
||||
if (opts.localAddress) {
|
||||
this.localAddress = opts.localAddress;
|
||||
}
|
||||
}
|
||||
|
||||
// set on handshake
|
||||
this.id = null;
|
||||
this.upgrades = null;
|
||||
this.pingInterval = null;
|
||||
this.pingTimeout = null;
|
||||
|
||||
// set on heartbeat
|
||||
this.pingIntervalTimer = null;
|
||||
this.pingTimeoutTimer = null;
|
||||
|
||||
this.open();
|
||||
}
|
||||
|
||||
Socket.priorWebsocketSuccess = false;
|
||||
|
||||
/**
|
||||
* Mix in `Emitter`.
|
||||
*/
|
||||
|
||||
Emitter(Socket.prototype);
|
||||
|
||||
/**
|
||||
* Protocol version.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Socket.protocol = parser.protocol; // this is an int
|
||||
|
||||
/**
|
||||
* Expose deps for legacy compatibility
|
||||
* and standalone browser access.
|
||||
*/
|
||||
|
||||
Socket.Socket = Socket;
|
||||
Socket.Transport = require('./transport');
|
||||
Socket.transports = require('./transports/index');
|
||||
Socket.parser = require('engine.io-parser');
|
||||
|
||||
/**
|
||||
* Creates transport of the given type.
|
||||
*
|
||||
* @param {String} transport name
|
||||
* @return {Transport}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Socket.prototype.createTransport = function (name) {
|
||||
debug('creating transport "%s"', name);
|
||||
var query = clone(this.query);
|
||||
|
||||
// append engine.io protocol identifier
|
||||
query.EIO = parser.protocol;
|
||||
|
||||
// transport name
|
||||
query.transport = name;
|
||||
|
||||
// session id if we already have one
|
||||
if (this.id) query.sid = this.id;
|
||||
|
||||
var transport = new transports[name]({
|
||||
agent: this.agent,
|
||||
hostname: this.hostname,
|
||||
port: this.port,
|
||||
secure: this.secure,
|
||||
path: this.path,
|
||||
query: query,
|
||||
forceJSONP: this.forceJSONP,
|
||||
jsonp: this.jsonp,
|
||||
forceBase64: this.forceBase64,
|
||||
enablesXDR: this.enablesXDR,
|
||||
timestampRequests: this.timestampRequests,
|
||||
timestampParam: this.timestampParam,
|
||||
policyPort: this.policyPort,
|
||||
socket: this,
|
||||
pfx: this.pfx,
|
||||
key: this.key,
|
||||
passphrase: this.passphrase,
|
||||
cert: this.cert,
|
||||
ca: this.ca,
|
||||
ciphers: this.ciphers,
|
||||
rejectUnauthorized: this.rejectUnauthorized,
|
||||
perMessageDeflate: this.perMessageDeflate,
|
||||
extraHeaders: this.extraHeaders,
|
||||
forceNode: this.forceNode,
|
||||
localAddress: this.localAddress
|
||||
});
|
||||
|
||||
return transport;
|
||||
};
|
||||
|
||||
function clone (obj) {
|
||||
var o = {};
|
||||
for (var i in obj) {
|
||||
if (obj.hasOwnProperty(i)) {
|
||||
o[i] = obj[i];
|
||||
}
|
||||
}
|
||||
return o;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes transport to use and starts probe.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
Socket.prototype.open = function () {
|
||||
var transport;
|
||||
if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) {
|
||||
transport = 'websocket';
|
||||
} else if (0 === this.transports.length) {
|
||||
// Emit error on next tick so it can be listened to
|
||||
var self = this;
|
||||
setTimeout(function () {
|
||||
self.emit('error', 'No transports available');
|
||||
}, 0);
|
||||
return;
|
||||
} else {
|
||||
transport = this.transports[0];
|
||||
}
|
||||
this.readyState = 'opening';
|
||||
|
||||
// Retry with the next transport if the transport is disabled (jsonp: false)
|
||||
try {
|
||||
transport = this.createTransport(transport);
|
||||
} catch (e) {
|
||||
this.transports.shift();
|
||||
this.open();
|
||||
return;
|
||||
}
|
||||
|
||||
transport.open();
|
||||
this.setTransport(transport);
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the current transport. Disables the existing one (if any).
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Socket.prototype.setTransport = function (transport) {
|
||||
debug('setting transport %s', transport.name);
|
||||
var self = this;
|
||||
|
||||
if (this.transport) {
|
||||
debug('clearing existing transport %s', this.transport.name);
|
||||
this.transport.removeAllListeners();
|
||||
}
|
||||
|
||||
// set up transport
|
||||
this.transport = transport;
|
||||
|
||||
// set up transport listeners
|
||||
transport
|
||||
.on('drain', function () {
|
||||
self.onDrain();
|
||||
})
|
||||
.on('packet', function (packet) {
|
||||
self.onPacket(packet);
|
||||
})
|
||||
.on('error', function (e) {
|
||||
self.onError(e);
|
||||
})
|
||||
.on('close', function () {
|
||||
self.onClose('transport close');
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Probes a transport.
|
||||
*
|
||||
* @param {String} transport name
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Socket.prototype.probe = function (name) {
|
||||
debug('probing transport "%s"', name);
|
||||
var transport = this.createTransport(name, { probe: 1 });
|
||||
var failed = false;
|
||||
var self = this;
|
||||
|
||||
Socket.priorWebsocketSuccess = false;
|
||||
|
||||
function onTransportOpen () {
|
||||
if (self.onlyBinaryUpgrades) {
|
||||
var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;
|
||||
failed = failed || upgradeLosesBinary;
|
||||
}
|
||||
if (failed) return;
|
||||
|
||||
debug('probe transport "%s" opened', name);
|
||||
transport.send([{ type: 'ping', data: 'probe' }]);
|
||||
transport.once('packet', function (msg) {
|
||||
if (failed) return;
|
||||
if ('pong' === msg.type && 'probe' === msg.data) {
|
||||
debug('probe transport "%s" pong', name);
|
||||
self.upgrading = true;
|
||||
self.emit('upgrading', transport);
|
||||
if (!transport) return;
|
||||
Socket.priorWebsocketSuccess = 'websocket' === transport.name;
|
||||
|
||||
debug('pausing current transport "%s"', self.transport.name);
|
||||
self.transport.pause(function () {
|
||||
if (failed) return;
|
||||
if ('closed' === self.readyState) return;
|
||||
debug('changing transport and sending upgrade packet');
|
||||
|
||||
cleanup();
|
||||
|
||||
self.setTransport(transport);
|
||||
transport.send([{ type: 'upgrade' }]);
|
||||
self.emit('upgrade', transport);
|
||||
transport = null;
|
||||
self.upgrading = false;
|
||||
self.flush();
|
||||
});
|
||||
} else {
|
||||
debug('probe transport "%s" failed', name);
|
||||
var err = new Error('probe error');
|
||||
err.transport = transport.name;
|
||||
self.emit('upgradeError', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function freezeTransport () {
|
||||
if (failed) return;
|
||||
|
||||
// Any callback called by transport should be ignored since now
|
||||
failed = true;
|
||||
|
||||
cleanup();
|
||||
|
||||
transport.close();
|
||||
transport = null;
|
||||
}
|
||||
|
||||
// Handle any error that happens while probing
|
||||
function onerror (err) {
|
||||
var error = new Error('probe error: ' + err);
|
||||
error.transport = transport.name;
|
||||
|
||||
freezeTransport();
|
||||
|
||||
debug('probe transport "%s" failed because of error: %s', name, err);
|
||||
|
||||
self.emit('upgradeError', error);
|
||||
}
|
||||
|
||||
function onTransportClose () {
|
||||
onerror('transport closed');
|
||||
}
|
||||
|
||||
// When the socket is closed while we're probing
|
||||
function onclose () {
|
||||
onerror('socket closed');
|
||||
}
|
||||
|
||||
// When the socket is upgraded while we're probing
|
||||
function onupgrade (to) {
|
||||
if (transport && to.name !== transport.name) {
|
||||
debug('"%s" works - aborting "%s"', to.name, transport.name);
|
||||
freezeTransport();
|
||||
}
|
||||
}
|
||||
|
||||
// Remove all listeners on the transport and on self
|
||||
function cleanup () {
|
||||
transport.removeListener('open', onTransportOpen);
|
||||
transport.removeListener('error', onerror);
|
||||
transport.removeListener('close', onTransportClose);
|
||||
self.removeListener('close', onclose);
|
||||
self.removeListener('upgrading', onupgrade);
|
||||
}
|
||||
|
||||
transport.once('open', onTransportOpen);
|
||||
transport.once('error', onerror);
|
||||
transport.once('close', onTransportClose);
|
||||
|
||||
this.once('close', onclose);
|
||||
this.once('upgrading', onupgrade);
|
||||
|
||||
transport.open();
|
||||
};
|
||||
|
||||
/**
|
||||
* Called when connection is deemed open.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Socket.prototype.onOpen = function () {
|
||||
debug('socket open');
|
||||
this.readyState = 'open';
|
||||
Socket.priorWebsocketSuccess = 'websocket' === this.transport.name;
|
||||
this.emit('open');
|
||||
this.flush();
|
||||
|
||||
// we check for `readyState` in case an `open`
|
||||
// listener already closed the socket
|
||||
if ('open' === this.readyState && this.upgrade && this.transport.pause) {
|
||||
debug('starting upgrade probes');
|
||||
for (var i = 0, l = this.upgrades.length; i < l; i++) {
|
||||
this.probe(this.upgrades[i]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles a packet.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Socket.prototype.onPacket = function (packet) {
|
||||
if ('opening' === this.readyState || 'open' === this.readyState ||
|
||||
'closing' === this.readyState) {
|
||||
debug('socket receive: type "%s", data "%s"', packet.type, packet.data);
|
||||
|
||||
this.emit('packet', packet);
|
||||
|
||||
// Socket is live - any packet counts
|
||||
this.emit('heartbeat');
|
||||
|
||||
switch (packet.type) {
|
||||
case 'open':
|
||||
this.onHandshake(parsejson(packet.data));
|
||||
break;
|
||||
|
||||
case 'pong':
|
||||
this.setPing();
|
||||
this.emit('pong');
|
||||
break;
|
||||
|
||||
case 'error':
|
||||
var err = new Error('server error');
|
||||
err.code = packet.data;
|
||||
this.onError(err);
|
||||
break;
|
||||
|
||||
case 'message':
|
||||
this.emit('data', packet.data);
|
||||
this.emit('message', packet.data);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
debug('packet received with socket readyState "%s"', this.readyState);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Called upon handshake completion.
|
||||
*
|
||||
* @param {Object} handshake obj
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Socket.prototype.onHandshake = function (data) {
|
||||
this.emit('handshake', data);
|
||||
this.id = data.sid;
|
||||
this.transport.query.sid = data.sid;
|
||||
this.upgrades = this.filterUpgrades(data.upgrades);
|
||||
this.pingInterval = data.pingInterval;
|
||||
this.pingTimeout = data.pingTimeout;
|
||||
this.onOpen();
|
||||
// In case open handler closes socket
|
||||
if ('closed' === this.readyState) return;
|
||||
this.setPing();
|
||||
|
||||
// Prolong liveness of socket on heartbeat
|
||||
this.removeListener('heartbeat', this.onHeartbeat);
|
||||
this.on('heartbeat', this.onHeartbeat);
|
||||
};
|
||||
|
||||
/**
|
||||
* Resets ping timeout.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Socket.prototype.onHeartbeat = function (timeout) {
|
||||
clearTimeout(this.pingTimeoutTimer);
|
||||
var self = this;
|
||||
self.pingTimeoutTimer = setTimeout(function () {
|
||||
if ('closed' === self.readyState) return;
|
||||
self.onClose('ping timeout');
|
||||
}, timeout || (self.pingInterval + self.pingTimeout));
|
||||
};
|
||||
|
||||
/**
|
||||
* Pings server every `this.pingInterval` and expects response
|
||||
* within `this.pingTimeout` or closes connection.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Socket.prototype.setPing = function () {
|
||||
var self = this;
|
||||
clearTimeout(self.pingIntervalTimer);
|
||||
self.pingIntervalTimer = setTimeout(function () {
|
||||
debug('writing ping packet - expecting pong within %sms', self.pingTimeout);
|
||||
self.ping();
|
||||
self.onHeartbeat(self.pingTimeout);
|
||||
}, self.pingInterval);
|
||||
};
|
||||
|
||||
/**
|
||||
* Sends a ping packet.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Socket.prototype.ping = function () {
|
||||
var self = this;
|
||||
this.sendPacket('ping', function () {
|
||||
self.emit('ping');
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Called on `drain` event
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Socket.prototype.onDrain = function () {
|
||||
this.writeBuffer.splice(0, this.prevBufferLen);
|
||||
|
||||
// setting prevBufferLen = 0 is very important
|
||||
// for example, when upgrading, upgrade packet is sent over,
|
||||
// and a nonzero prevBufferLen could cause problems on `drain`
|
||||
this.prevBufferLen = 0;
|
||||
|
||||
if (0 === this.writeBuffer.length) {
|
||||
this.emit('drain');
|
||||
} else {
|
||||
this.flush();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Flush write buffers.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Socket.prototype.flush = function () {
|
||||
if ('closed' !== this.readyState && this.transport.writable &&
|
||||
!this.upgrading && this.writeBuffer.length) {
|
||||
debug('flushing %d packets in socket', this.writeBuffer.length);
|
||||
this.transport.send(this.writeBuffer);
|
||||
// keep track of current length of writeBuffer
|
||||
// splice writeBuffer and callbackBuffer on `drain`
|
||||
this.prevBufferLen = this.writeBuffer.length;
|
||||
this.emit('flush');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Sends a message.
|
||||
*
|
||||
* @param {String} message.
|
||||
* @param {Function} callback function.
|
||||
* @param {Object} options.
|
||||
* @return {Socket} for chaining.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Socket.prototype.write =
|
||||
Socket.prototype.send = function (msg, options, fn) {
|
||||
this.sendPacket('message', msg, options, fn);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Sends a packet.
|
||||
*
|
||||
* @param {String} packet type.
|
||||
* @param {String} data.
|
||||
* @param {Object} options.
|
||||
* @param {Function} callback function.
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Socket.prototype.sendPacket = function (type, data, options, fn) {
|
||||
if ('function' === typeof data) {
|
||||
fn = data;
|
||||
data = undefined;
|
||||
}
|
||||
|
||||
if ('function' === typeof options) {
|
||||
fn = options;
|
||||
options = null;
|
||||
}
|
||||
|
||||
if ('closing' === this.readyState || 'closed' === this.readyState) {
|
||||
return;
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
options.compress = false !== options.compress;
|
||||
|
||||
var packet = {
|
||||
type: type,
|
||||
data: data,
|
||||
options: options
|
||||
};
|
||||
this.emit('packetCreate', packet);
|
||||
this.writeBuffer.push(packet);
|
||||
if (fn) this.once('flush', fn);
|
||||
this.flush();
|
||||
};
|
||||
|
||||
/**
|
||||
* Closes the connection.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Socket.prototype.close = function () {
|
||||
if ('opening' === this.readyState || 'open' === this.readyState) {
|
||||
this.readyState = 'closing';
|
||||
|
||||
var self = this;
|
||||
|
||||
if (this.writeBuffer.length) {
|
||||
this.once('drain', function () {
|
||||
if (this.upgrading) {
|
||||
waitForUpgrade();
|
||||
} else {
|
||||
close();
|
||||
}
|
||||
});
|
||||
} else if (this.upgrading) {
|
||||
waitForUpgrade();
|
||||
} else {
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
function close () {
|
||||
self.onClose('forced close');
|
||||
debug('socket closing - telling transport to close');
|
||||
self.transport.close();
|
||||
}
|
||||
|
||||
function cleanupAndClose () {
|
||||
self.removeListener('upgrade', cleanupAndClose);
|
||||
self.removeListener('upgradeError', cleanupAndClose);
|
||||
close();
|
||||
}
|
||||
|
||||
function waitForUpgrade () {
|
||||
// wait for upgrade to finish since we can't send packets while pausing a transport
|
||||
self.once('upgrade', cleanupAndClose);
|
||||
self.once('upgradeError', cleanupAndClose);
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Called upon transport error
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Socket.prototype.onError = function (err) {
|
||||
debug('socket error %j', err);
|
||||
Socket.priorWebsocketSuccess = false;
|
||||
this.emit('error', err);
|
||||
this.onClose('transport error', err);
|
||||
};
|
||||
|
||||
/**
|
||||
* Called upon transport close.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Socket.prototype.onClose = function (reason, desc) {
|
||||
if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {
|
||||
debug('socket close with reason: "%s"', reason);
|
||||
var self = this;
|
||||
|
||||
// clear timers
|
||||
clearTimeout(this.pingIntervalTimer);
|
||||
clearTimeout(this.pingTimeoutTimer);
|
||||
|
||||
// stop event from firing again for transport
|
||||
this.transport.removeAllListeners('close');
|
||||
|
||||
// ensure transport won't stay open
|
||||
this.transport.close();
|
||||
|
||||
// ignore further transport communication
|
||||
this.transport.removeAllListeners();
|
||||
|
||||
// set ready state
|
||||
this.readyState = 'closed';
|
||||
|
||||
// clear session id
|
||||
this.id = null;
|
||||
|
||||
// emit close event
|
||||
this.emit('close', reason, desc);
|
||||
|
||||
// clean buffers after, so users can still
|
||||
// grab the buffers on `close` event
|
||||
self.writeBuffer = [];
|
||||
self.prevBufferLen = 0;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Filters upgrades, returning only those matching client transports.
|
||||
*
|
||||
* @param {Array} server upgrades
|
||||
* @api private
|
||||
*
|
||||
*/
|
||||
|
||||
Socket.prototype.filterUpgrades = function (upgrades) {
|
||||
var filteredUpgrades = [];
|
||||
for (var i = 0, j = upgrades.length; i < j; i++) {
|
||||
if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);
|
||||
}
|
||||
return filteredUpgrades;
|
||||
};
|
157
node_modules/engine.io-client/lib/transport.js
generated
vendored
Normal file
157
node_modules/engine.io-client/lib/transport.js
generated
vendored
Normal file
@ -0,0 +1,157 @@
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var parser = require('engine.io-parser');
|
||||
var Emitter = require('component-emitter');
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = Transport;
|
||||
|
||||
/**
|
||||
* Transport abstract constructor.
|
||||
*
|
||||
* @param {Object} options.
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function Transport (opts) {
|
||||
this.path = opts.path;
|
||||
this.hostname = opts.hostname;
|
||||
this.port = opts.port;
|
||||
this.secure = opts.secure;
|
||||
this.query = opts.query;
|
||||
this.timestampParam = opts.timestampParam;
|
||||
this.timestampRequests = opts.timestampRequests;
|
||||
this.readyState = '';
|
||||
this.agent = opts.agent || false;
|
||||
this.socket = opts.socket;
|
||||
this.enablesXDR = opts.enablesXDR;
|
||||
|
||||
// SSL options for Node.js client
|
||||
this.pfx = opts.pfx;
|
||||
this.key = opts.key;
|
||||
this.passphrase = opts.passphrase;
|
||||
this.cert = opts.cert;
|
||||
this.ca = opts.ca;
|
||||
this.ciphers = opts.ciphers;
|
||||
this.rejectUnauthorized = opts.rejectUnauthorized;
|
||||
this.forceNode = opts.forceNode;
|
||||
|
||||
// other options for Node.js client
|
||||
this.extraHeaders = opts.extraHeaders;
|
||||
this.localAddress = opts.localAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mix in `Emitter`.
|
||||
*/
|
||||
|
||||
Emitter(Transport.prototype);
|
||||
|
||||
/**
|
||||
* Emits an error.
|
||||
*
|
||||
* @param {String} str
|
||||
* @return {Transport} for chaining
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Transport.prototype.onError = function (msg, desc) {
|
||||
var err = new Error(msg);
|
||||
err.type = 'TransportError';
|
||||
err.description = desc;
|
||||
this.emit('error', err);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Opens the transport.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Transport.prototype.open = function () {
|
||||
if ('closed' === this.readyState || '' === this.readyState) {
|
||||
this.readyState = 'opening';
|
||||
this.doOpen();
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Closes the transport.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Transport.prototype.close = function () {
|
||||
if ('opening' === this.readyState || 'open' === this.readyState) {
|
||||
this.doClose();
|
||||
this.onClose();
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Sends multiple packets.
|
||||
*
|
||||
* @param {Array} packets
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Transport.prototype.send = function (packets) {
|
||||
if ('open' === this.readyState) {
|
||||
this.write(packets);
|
||||
} else {
|
||||
throw new Error('Transport not open');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Called upon open
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Transport.prototype.onOpen = function () {
|
||||
this.readyState = 'open';
|
||||
this.writable = true;
|
||||
this.emit('open');
|
||||
};
|
||||
|
||||
/**
|
||||
* Called with data.
|
||||
*
|
||||
* @param {String} data
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Transport.prototype.onData = function (data) {
|
||||
var packet = parser.decodePacket(data, this.socket.binaryType);
|
||||
this.onPacket(packet);
|
||||
};
|
||||
|
||||
/**
|
||||
* Called with a decoded packet.
|
||||
*/
|
||||
|
||||
Transport.prototype.onPacket = function (packet) {
|
||||
this.emit('packet', packet);
|
||||
};
|
||||
|
||||
/**
|
||||
* Called upon close.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Transport.prototype.onClose = function () {
|
||||
this.readyState = 'closed';
|
||||
this.emit('close');
|
||||
};
|
53
node_modules/engine.io-client/lib/transports/index.js
generated
vendored
Normal file
53
node_modules/engine.io-client/lib/transports/index.js
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
|
||||
var XMLHttpRequest = require('xmlhttprequest-ssl');
|
||||
var XHR = require('./polling-xhr');
|
||||
var JSONP = require('./polling-jsonp');
|
||||
var websocket = require('./websocket');
|
||||
|
||||
/**
|
||||
* Export transports.
|
||||
*/
|
||||
|
||||
exports.polling = polling;
|
||||
exports.websocket = websocket;
|
||||
|
||||
/**
|
||||
* Polling transport polymorphic constructor.
|
||||
* Decides on xhr vs jsonp based on feature detection.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function polling (opts) {
|
||||
var xhr;
|
||||
var xd = false;
|
||||
var xs = false;
|
||||
var jsonp = false !== opts.jsonp;
|
||||
|
||||
if (global.location) {
|
||||
var isSSL = 'https:' === location.protocol;
|
||||
var port = location.port;
|
||||
|
||||
// some user agents have empty `location.port`
|
||||
if (!port) {
|
||||
port = isSSL ? 443 : 80;
|
||||
}
|
||||
|
||||
xd = opts.hostname !== location.hostname || port !== opts.port;
|
||||
xs = opts.secure !== isSSL;
|
||||
}
|
||||
|
||||
opts.xdomain = xd;
|
||||
opts.xscheme = xs;
|
||||
xhr = new XMLHttpRequest(opts);
|
||||
|
||||
if ('open' in xhr && !opts.forceJSONP) {
|
||||
return new XHR(opts);
|
||||
} else {
|
||||
if (!jsonp) throw new Error('JSONP disabled');
|
||||
return new JSONP(opts);
|
||||
}
|
||||
}
|
231
node_modules/engine.io-client/lib/transports/polling-jsonp.js
generated
vendored
Normal file
231
node_modules/engine.io-client/lib/transports/polling-jsonp.js
generated
vendored
Normal file
@ -0,0 +1,231 @@
|
||||
|
||||
/**
|
||||
* Module requirements.
|
||||
*/
|
||||
|
||||
var Polling = require('./polling');
|
||||
var inherit = require('component-inherit');
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = JSONPPolling;
|
||||
|
||||
/**
|
||||
* Cached regular expressions.
|
||||
*/
|
||||
|
||||
var rNewline = /\n/g;
|
||||
var rEscapedNewline = /\\n/g;
|
||||
|
||||
/**
|
||||
* Global JSONP callbacks.
|
||||
*/
|
||||
|
||||
var callbacks;
|
||||
|
||||
/**
|
||||
* Noop.
|
||||
*/
|
||||
|
||||
function empty () { }
|
||||
|
||||
/**
|
||||
* JSONP Polling constructor.
|
||||
*
|
||||
* @param {Object} opts.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function JSONPPolling (opts) {
|
||||
Polling.call(this, opts);
|
||||
|
||||
this.query = this.query || {};
|
||||
|
||||
// define global callbacks array if not present
|
||||
// we do this here (lazily) to avoid unneeded global pollution
|
||||
if (!callbacks) {
|
||||
// we need to consider multiple engines in the same page
|
||||
if (!global.___eio) global.___eio = [];
|
||||
callbacks = global.___eio;
|
||||
}
|
||||
|
||||
// callback identifier
|
||||
this.index = callbacks.length;
|
||||
|
||||
// add callback to jsonp global
|
||||
var self = this;
|
||||
callbacks.push(function (msg) {
|
||||
self.onData(msg);
|
||||
});
|
||||
|
||||
// append to query string
|
||||
this.query.j = this.index;
|
||||
|
||||
// prevent spurious errors from being emitted when the window is unloaded
|
||||
if (global.document && global.addEventListener) {
|
||||
global.addEventListener('beforeunload', function () {
|
||||
if (self.script) self.script.onerror = empty;
|
||||
}, false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Inherits from Polling.
|
||||
*/
|
||||
|
||||
inherit(JSONPPolling, Polling);
|
||||
|
||||
/*
|
||||
* JSONP only supports binary as base64 encoded strings
|
||||
*/
|
||||
|
||||
JSONPPolling.prototype.supportsBinary = false;
|
||||
|
||||
/**
|
||||
* Closes the socket.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
JSONPPolling.prototype.doClose = function () {
|
||||
if (this.script) {
|
||||
this.script.parentNode.removeChild(this.script);
|
||||
this.script = null;
|
||||
}
|
||||
|
||||
if (this.form) {
|
||||
this.form.parentNode.removeChild(this.form);
|
||||
this.form = null;
|
||||
this.iframe = null;
|
||||
}
|
||||
|
||||
Polling.prototype.doClose.call(this);
|
||||
};
|
||||
|
||||
/**
|
||||
* Starts a poll cycle.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
JSONPPolling.prototype.doPoll = function () {
|
||||
var self = this;
|
||||
var script = document.createElement('script');
|
||||
|
||||
if (this.script) {
|
||||
this.script.parentNode.removeChild(this.script);
|
||||
this.script = null;
|
||||
}
|
||||
|
||||
script.async = true;
|
||||
script.src = this.uri();
|
||||
script.onerror = function (e) {
|
||||
self.onError('jsonp poll error', e);
|
||||
};
|
||||
|
||||
var insertAt = document.getElementsByTagName('script')[0];
|
||||
if (insertAt) {
|
||||
insertAt.parentNode.insertBefore(script, insertAt);
|
||||
} else {
|
||||
(document.head || document.body).appendChild(script);
|
||||
}
|
||||
this.script = script;
|
||||
|
||||
var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent);
|
||||
|
||||
if (isUAgecko) {
|
||||
setTimeout(function () {
|
||||
var iframe = document.createElement('iframe');
|
||||
document.body.appendChild(iframe);
|
||||
document.body.removeChild(iframe);
|
||||
}, 100);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Writes with a hidden iframe.
|
||||
*
|
||||
* @param {String} data to send
|
||||
* @param {Function} called upon flush.
|
||||
* @api private
|
||||
*/
|
||||
|
||||
JSONPPolling.prototype.doWrite = function (data, fn) {
|
||||
var self = this;
|
||||
|
||||
if (!this.form) {
|
||||
var form = document.createElement('form');
|
||||
var area = document.createElement('textarea');
|
||||
var id = this.iframeId = 'eio_iframe_' + this.index;
|
||||
var iframe;
|
||||
|
||||
form.className = 'socketio';
|
||||
form.style.position = 'absolute';
|
||||
form.style.top = '-1000px';
|
||||
form.style.left = '-1000px';
|
||||
form.target = id;
|
||||
form.method = 'POST';
|
||||
form.setAttribute('accept-charset', 'utf-8');
|
||||
area.name = 'd';
|
||||
form.appendChild(area);
|
||||
document.body.appendChild(form);
|
||||
|
||||
this.form = form;
|
||||
this.area = area;
|
||||
}
|
||||
|
||||
this.form.action = this.uri();
|
||||
|
||||
function complete () {
|
||||
initIframe();
|
||||
fn();
|
||||
}
|
||||
|
||||
function initIframe () {
|
||||
if (self.iframe) {
|
||||
try {
|
||||
self.form.removeChild(self.iframe);
|
||||
} catch (e) {
|
||||
self.onError('jsonp polling iframe removal error', e);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
// ie6 dynamic iframes with target="" support (thanks Chris Lambacher)
|
||||
var html = '<iframe src="javascript:0" name="' + self.iframeId + '">';
|
||||
iframe = document.createElement(html);
|
||||
} catch (e) {
|
||||
iframe = document.createElement('iframe');
|
||||
iframe.name = self.iframeId;
|
||||
iframe.src = 'javascript:0';
|
||||
}
|
||||
|
||||
iframe.id = self.iframeId;
|
||||
|
||||
self.form.appendChild(iframe);
|
||||
self.iframe = iframe;
|
||||
}
|
||||
|
||||
initIframe();
|
||||
|
||||
// escape \n to prevent it from being converted into \r\n by some UAs
|
||||
// double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side
|
||||
data = data.replace(rEscapedNewline, '\\\n');
|
||||
this.area.value = data.replace(rNewline, '\\n');
|
||||
|
||||
try {
|
||||
this.form.submit();
|
||||
} catch (e) {}
|
||||
|
||||
if (this.iframe.attachEvent) {
|
||||
this.iframe.onreadystatechange = function () {
|
||||
if (self.iframe.readyState === 'complete') {
|
||||
complete();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
this.iframe.onload = complete;
|
||||
}
|
||||
};
|
424
node_modules/engine.io-client/lib/transports/polling-xhr.js
generated
vendored
Normal file
424
node_modules/engine.io-client/lib/transports/polling-xhr.js
generated
vendored
Normal file
@ -0,0 +1,424 @@
|
||||
/**
|
||||
* Module requirements.
|
||||
*/
|
||||
|
||||
var XMLHttpRequest = require('xmlhttprequest-ssl');
|
||||
var Polling = require('./polling');
|
||||
var Emitter = require('component-emitter');
|
||||
var inherit = require('component-inherit');
|
||||
var debug = require('debug')('engine.io-client:polling-xhr');
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = XHR;
|
||||
module.exports.Request = Request;
|
||||
|
||||
/**
|
||||
* Empty function
|
||||
*/
|
||||
|
||||
function empty () {}
|
||||
|
||||
/**
|
||||
* XHR Polling constructor.
|
||||
*
|
||||
* @param {Object} opts
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function XHR (opts) {
|
||||
Polling.call(this, opts);
|
||||
this.requestTimeout = opts.requestTimeout;
|
||||
|
||||
if (global.location) {
|
||||
var isSSL = 'https:' === location.protocol;
|
||||
var port = location.port;
|
||||
|
||||
// some user agents have empty `location.port`
|
||||
if (!port) {
|
||||
port = isSSL ? 443 : 80;
|
||||
}
|
||||
|
||||
this.xd = opts.hostname !== global.location.hostname ||
|
||||
port !== opts.port;
|
||||
this.xs = opts.secure !== isSSL;
|
||||
} else {
|
||||
this.extraHeaders = opts.extraHeaders;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Inherits from Polling.
|
||||
*/
|
||||
|
||||
inherit(XHR, Polling);
|
||||
|
||||
/**
|
||||
* XHR supports binary
|
||||
*/
|
||||
|
||||
XHR.prototype.supportsBinary = true;
|
||||
|
||||
/**
|
||||
* Creates a request.
|
||||
*
|
||||
* @param {String} method
|
||||
* @api private
|
||||
*/
|
||||
|
||||
XHR.prototype.request = function (opts) {
|
||||
opts = opts || {};
|
||||
opts.uri = this.uri();
|
||||
opts.xd = this.xd;
|
||||
opts.xs = this.xs;
|
||||
opts.agent = this.agent || false;
|
||||
opts.supportsBinary = this.supportsBinary;
|
||||
opts.enablesXDR = this.enablesXDR;
|
||||
|
||||
// SSL options for Node.js client
|
||||
opts.pfx = this.pfx;
|
||||
opts.key = this.key;
|
||||
opts.passphrase = this.passphrase;
|
||||
opts.cert = this.cert;
|
||||
opts.ca = this.ca;
|
||||
opts.ciphers = this.ciphers;
|
||||
opts.rejectUnauthorized = this.rejectUnauthorized;
|
||||
opts.requestTimeout = this.requestTimeout;
|
||||
|
||||
// other options for Node.js client
|
||||
opts.extraHeaders = this.extraHeaders;
|
||||
|
||||
return new Request(opts);
|
||||
};
|
||||
|
||||
/**
|
||||
* Sends data.
|
||||
*
|
||||
* @param {String} data to send.
|
||||
* @param {Function} called upon flush.
|
||||
* @api private
|
||||
*/
|
||||
|
||||
XHR.prototype.doWrite = function (data, fn) {
|
||||
var isBinary = typeof data !== 'string' && data !== undefined;
|
||||
var req = this.request({ method: 'POST', data: data, isBinary: isBinary });
|
||||
var self = this;
|
||||
req.on('success', fn);
|
||||
req.on('error', function (err) {
|
||||
self.onError('xhr post error', err);
|
||||
});
|
||||
this.sendXhr = req;
|
||||
};
|
||||
|
||||
/**
|
||||
* Starts a poll cycle.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
XHR.prototype.doPoll = function () {
|
||||
debug('xhr poll');
|
||||
var req = this.request();
|
||||
var self = this;
|
||||
req.on('data', function (data) {
|
||||
self.onData(data);
|
||||
});
|
||||
req.on('error', function (err) {
|
||||
self.onError('xhr poll error', err);
|
||||
});
|
||||
this.pollXhr = req;
|
||||
};
|
||||
|
||||
/**
|
||||
* Request constructor
|
||||
*
|
||||
* @param {Object} options
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function Request (opts) {
|
||||
this.method = opts.method || 'GET';
|
||||
this.uri = opts.uri;
|
||||
this.xd = !!opts.xd;
|
||||
this.xs = !!opts.xs;
|
||||
this.async = false !== opts.async;
|
||||
this.data = undefined !== opts.data ? opts.data : null;
|
||||
this.agent = opts.agent;
|
||||
this.isBinary = opts.isBinary;
|
||||
this.supportsBinary = opts.supportsBinary;
|
||||
this.enablesXDR = opts.enablesXDR;
|
||||
this.requestTimeout = opts.requestTimeout;
|
||||
|
||||
// SSL options for Node.js client
|
||||
this.pfx = opts.pfx;
|
||||
this.key = opts.key;
|
||||
this.passphrase = opts.passphrase;
|
||||
this.cert = opts.cert;
|
||||
this.ca = opts.ca;
|
||||
this.ciphers = opts.ciphers;
|
||||
this.rejectUnauthorized = opts.rejectUnauthorized;
|
||||
|
||||
// other options for Node.js client
|
||||
this.extraHeaders = opts.extraHeaders;
|
||||
|
||||
this.create();
|
||||
}
|
||||
|
||||
/**
|
||||
* Mix in `Emitter`.
|
||||
*/
|
||||
|
||||
Emitter(Request.prototype);
|
||||
|
||||
/**
|
||||
* Creates the XHR object and sends the request.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Request.prototype.create = function () {
|
||||
var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };
|
||||
|
||||
// SSL options for Node.js client
|
||||
opts.pfx = this.pfx;
|
||||
opts.key = this.key;
|
||||
opts.passphrase = this.passphrase;
|
||||
opts.cert = this.cert;
|
||||
opts.ca = this.ca;
|
||||
opts.ciphers = this.ciphers;
|
||||
opts.rejectUnauthorized = this.rejectUnauthorized;
|
||||
|
||||
var xhr = this.xhr = new XMLHttpRequest(opts);
|
||||
var self = this;
|
||||
|
||||
try {
|
||||
debug('xhr open %s: %s', this.method, this.uri);
|
||||
xhr.open(this.method, this.uri, this.async);
|
||||
try {
|
||||
if (this.extraHeaders) {
|
||||
xhr.setDisableHeaderCheck(true);
|
||||
for (var i in this.extraHeaders) {
|
||||
if (this.extraHeaders.hasOwnProperty(i)) {
|
||||
xhr.setRequestHeader(i, this.extraHeaders[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
if (this.supportsBinary) {
|
||||
// This has to be done after open because Firefox is stupid
|
||||
// http://stackoverflow.com/questions/13216903/get-binary-data-with-xmlhttprequest-in-a-firefox-extension
|
||||
xhr.responseType = 'arraybuffer';
|
||||
}
|
||||
|
||||
if ('POST' === this.method) {
|
||||
try {
|
||||
if (this.isBinary) {
|
||||
xhr.setRequestHeader('Content-type', 'application/octet-stream');
|
||||
} else {
|
||||
xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
try {
|
||||
xhr.setRequestHeader('Accept', '*/*');
|
||||
} catch (e) {}
|
||||
|
||||
// ie6 check
|
||||
if ('withCredentials' in xhr) {
|
||||
xhr.withCredentials = true;
|
||||
}
|
||||
|
||||
if (this.requestTimeout) {
|
||||
xhr.timeout = this.requestTimeout;
|
||||
}
|
||||
|
||||
if (this.hasXDR()) {
|
||||
xhr.onload = function () {
|
||||
self.onLoad();
|
||||
};
|
||||
xhr.onerror = function () {
|
||||
self.onError(xhr.responseText);
|
||||
};
|
||||
} else {
|
||||
xhr.onreadystatechange = function () {
|
||||
if (4 !== xhr.readyState) return;
|
||||
if (200 === xhr.status || 1223 === xhr.status) {
|
||||
self.onLoad();
|
||||
} else {
|
||||
// make sure the `error` event handler that's user-set
|
||||
// does not throw in the same tick and gets caught here
|
||||
setTimeout(function () {
|
||||
self.onError(xhr.status);
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
debug('xhr data %s', this.data);
|
||||
xhr.send(this.data);
|
||||
} catch (e) {
|
||||
// Need to defer since .create() is called directly fhrom the constructor
|
||||
// and thus the 'error' event can only be only bound *after* this exception
|
||||
// occurs. Therefore, also, we cannot throw here at all.
|
||||
setTimeout(function () {
|
||||
self.onError(e);
|
||||
}, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (global.document) {
|
||||
this.index = Request.requestsCount++;
|
||||
Request.requests[this.index] = this;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Called upon successful response.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Request.prototype.onSuccess = function () {
|
||||
this.emit('success');
|
||||
this.cleanup();
|
||||
};
|
||||
|
||||
/**
|
||||
* Called if we have data.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Request.prototype.onData = function (data) {
|
||||
this.emit('data', data);
|
||||
this.onSuccess();
|
||||
};
|
||||
|
||||
/**
|
||||
* Called upon error.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Request.prototype.onError = function (err) {
|
||||
this.emit('error', err);
|
||||
this.cleanup(true);
|
||||
};
|
||||
|
||||
/**
|
||||
* Cleans up house.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Request.prototype.cleanup = function (fromError) {
|
||||
if ('undefined' === typeof this.xhr || null === this.xhr) {
|
||||
return;
|
||||
}
|
||||
// xmlhttprequest
|
||||
if (this.hasXDR()) {
|
||||
this.xhr.onload = this.xhr.onerror = empty;
|
||||
} else {
|
||||
this.xhr.onreadystatechange = empty;
|
||||
}
|
||||
|
||||
if (fromError) {
|
||||
try {
|
||||
this.xhr.abort();
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
if (global.document) {
|
||||
delete Request.requests[this.index];
|
||||
}
|
||||
|
||||
this.xhr = null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Called upon load.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Request.prototype.onLoad = function () {
|
||||
var data;
|
||||
try {
|
||||
var contentType;
|
||||
try {
|
||||
contentType = this.xhr.getResponseHeader('Content-Type').split(';')[0];
|
||||
} catch (e) {}
|
||||
if (contentType === 'application/octet-stream') {
|
||||
data = this.xhr.response || this.xhr.responseText;
|
||||
} else {
|
||||
if (!this.supportsBinary) {
|
||||
data = this.xhr.responseText;
|
||||
} else {
|
||||
try {
|
||||
data = String.fromCharCode.apply(null, new Uint8Array(this.xhr.response));
|
||||
} catch (e) {
|
||||
var ui8Arr = new Uint8Array(this.xhr.response);
|
||||
var dataArray = [];
|
||||
for (var idx = 0, length = ui8Arr.length; idx < length; idx++) {
|
||||
dataArray.push(ui8Arr[idx]);
|
||||
}
|
||||
|
||||
data = String.fromCharCode.apply(null, dataArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
this.onError(e);
|
||||
}
|
||||
if (null != data) {
|
||||
this.onData(data);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if it has XDomainRequest.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Request.prototype.hasXDR = function () {
|
||||
return 'undefined' !== typeof global.XDomainRequest && !this.xs && this.enablesXDR;
|
||||
};
|
||||
|
||||
/**
|
||||
* Aborts the request.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Request.prototype.abort = function () {
|
||||
this.cleanup();
|
||||
};
|
||||
|
||||
/**
|
||||
* Aborts pending requests when unloading the window. This is needed to prevent
|
||||
* memory leaks (e.g. when using IE) and to ensure that no spurious error is
|
||||
* emitted.
|
||||
*/
|
||||
|
||||
Request.requestsCount = 0;
|
||||
Request.requests = {};
|
||||
|
||||
if (global.document) {
|
||||
if (global.attachEvent) {
|
||||
global.attachEvent('onunload', unloadHandler);
|
||||
} else if (global.addEventListener) {
|
||||
global.addEventListener('beforeunload', unloadHandler, false);
|
||||
}
|
||||
}
|
||||
|
||||
function unloadHandler () {
|
||||
for (var i in Request.requests) {
|
||||
if (Request.requests.hasOwnProperty(i)) {
|
||||
Request.requests[i].abort();
|
||||
}
|
||||
}
|
||||
}
|
245
node_modules/engine.io-client/lib/transports/polling.js
generated
vendored
Normal file
245
node_modules/engine.io-client/lib/transports/polling.js
generated
vendored
Normal file
@ -0,0 +1,245 @@
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var Transport = require('../transport');
|
||||
var parseqs = require('parseqs');
|
||||
var parser = require('engine.io-parser');
|
||||
var inherit = require('component-inherit');
|
||||
var yeast = require('yeast');
|
||||
var debug = require('debug')('engine.io-client:polling');
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = Polling;
|
||||
|
||||
/**
|
||||
* Is XHR2 supported?
|
||||
*/
|
||||
|
||||
var hasXHR2 = (function () {
|
||||
var XMLHttpRequest = require('xmlhttprequest-ssl');
|
||||
var xhr = new XMLHttpRequest({ xdomain: false });
|
||||
return null != xhr.responseType;
|
||||
})();
|
||||
|
||||
/**
|
||||
* Polling interface.
|
||||
*
|
||||
* @param {Object} opts
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function Polling (opts) {
|
||||
var forceBase64 = (opts && opts.forceBase64);
|
||||
if (!hasXHR2 || forceBase64) {
|
||||
this.supportsBinary = false;
|
||||
}
|
||||
Transport.call(this, opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inherits from Transport.
|
||||
*/
|
||||
|
||||
inherit(Polling, Transport);
|
||||
|
||||
/**
|
||||
* Transport name.
|
||||
*/
|
||||
|
||||
Polling.prototype.name = 'polling';
|
||||
|
||||
/**
|
||||
* Opens the socket (triggers polling). We write a PING message to determine
|
||||
* when the transport is open.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Polling.prototype.doOpen = function () {
|
||||
this.poll();
|
||||
};
|
||||
|
||||
/**
|
||||
* Pauses polling.
|
||||
*
|
||||
* @param {Function} callback upon buffers are flushed and transport is paused
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Polling.prototype.pause = function (onPause) {
|
||||
var self = this;
|
||||
|
||||
this.readyState = 'pausing';
|
||||
|
||||
function pause () {
|
||||
debug('paused');
|
||||
self.readyState = 'paused';
|
||||
onPause();
|
||||
}
|
||||
|
||||
if (this.polling || !this.writable) {
|
||||
var total = 0;
|
||||
|
||||
if (this.polling) {
|
||||
debug('we are currently polling - waiting to pause');
|
||||
total++;
|
||||
this.once('pollComplete', function () {
|
||||
debug('pre-pause polling complete');
|
||||
--total || pause();
|
||||
});
|
||||
}
|
||||
|
||||
if (!this.writable) {
|
||||
debug('we are currently writing - waiting to pause');
|
||||
total++;
|
||||
this.once('drain', function () {
|
||||
debug('pre-pause writing complete');
|
||||
--total || pause();
|
||||
});
|
||||
}
|
||||
} else {
|
||||
pause();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Starts polling cycle.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Polling.prototype.poll = function () {
|
||||
debug('polling');
|
||||
this.polling = true;
|
||||
this.doPoll();
|
||||
this.emit('poll');
|
||||
};
|
||||
|
||||
/**
|
||||
* Overloads onData to detect payloads.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Polling.prototype.onData = function (data) {
|
||||
var self = this;
|
||||
debug('polling got data %s', data);
|
||||
var callback = function (packet, index, total) {
|
||||
// if its the first message we consider the transport open
|
||||
if ('opening' === self.readyState) {
|
||||
self.onOpen();
|
||||
}
|
||||
|
||||
// if its a close packet, we close the ongoing requests
|
||||
if ('close' === packet.type) {
|
||||
self.onClose();
|
||||
return false;
|
||||
}
|
||||
|
||||
// otherwise bypass onData and handle the message
|
||||
self.onPacket(packet);
|
||||
};
|
||||
|
||||
// decode payload
|
||||
parser.decodePayload(data, this.socket.binaryType, callback);
|
||||
|
||||
// if an event did not trigger closing
|
||||
if ('closed' !== this.readyState) {
|
||||
// if we got data we're not polling
|
||||
this.polling = false;
|
||||
this.emit('pollComplete');
|
||||
|
||||
if ('open' === this.readyState) {
|
||||
this.poll();
|
||||
} else {
|
||||
debug('ignoring poll - transport state "%s"', this.readyState);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* For polling, send a close packet.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Polling.prototype.doClose = function () {
|
||||
var self = this;
|
||||
|
||||
function close () {
|
||||
debug('writing close packet');
|
||||
self.write([{ type: 'close' }]);
|
||||
}
|
||||
|
||||
if ('open' === this.readyState) {
|
||||
debug('transport open - closing');
|
||||
close();
|
||||
} else {
|
||||
// in case we're trying to close while
|
||||
// handshaking is in progress (GH-164)
|
||||
debug('transport not open - deferring close');
|
||||
this.once('open', close);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Writes a packets payload.
|
||||
*
|
||||
* @param {Array} data packets
|
||||
* @param {Function} drain callback
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Polling.prototype.write = function (packets) {
|
||||
var self = this;
|
||||
this.writable = false;
|
||||
var callbackfn = function () {
|
||||
self.writable = true;
|
||||
self.emit('drain');
|
||||
};
|
||||
|
||||
parser.encodePayload(packets, this.supportsBinary, function (data) {
|
||||
self.doWrite(data, callbackfn);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Generates uri for connection.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Polling.prototype.uri = function () {
|
||||
var query = this.query || {};
|
||||
var schema = this.secure ? 'https' : 'http';
|
||||
var port = '';
|
||||
|
||||
// cache busting is forced
|
||||
if (false !== this.timestampRequests) {
|
||||
query[this.timestampParam] = yeast();
|
||||
}
|
||||
|
||||
if (!this.supportsBinary && !query.sid) {
|
||||
query.b64 = 1;
|
||||
}
|
||||
|
||||
query = parseqs.encode(query);
|
||||
|
||||
// avoid port if default for schema
|
||||
if (this.port && (('https' === schema && Number(this.port) !== 443) ||
|
||||
('http' === schema && Number(this.port) !== 80))) {
|
||||
port = ':' + this.port;
|
||||
}
|
||||
|
||||
// prepend ? to query
|
||||
if (query.length) {
|
||||
query = '?' + query;
|
||||
}
|
||||
|
||||
var ipv6 = this.hostname.indexOf(':') !== -1;
|
||||
return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
|
||||
};
|
285
node_modules/engine.io-client/lib/transports/websocket.js
generated
vendored
Normal file
285
node_modules/engine.io-client/lib/transports/websocket.js
generated
vendored
Normal file
@ -0,0 +1,285 @@
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var Transport = require('../transport');
|
||||
var parser = require('engine.io-parser');
|
||||
var parseqs = require('parseqs');
|
||||
var inherit = require('component-inherit');
|
||||
var yeast = require('yeast');
|
||||
var debug = require('debug')('engine.io-client:websocket');
|
||||
var BrowserWebSocket = global.WebSocket || global.MozWebSocket;
|
||||
var NodeWebSocket;
|
||||
if (typeof window === 'undefined') {
|
||||
try {
|
||||
NodeWebSocket = require('ws');
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
/**
|
||||
* Get either the `WebSocket` or `MozWebSocket` globals
|
||||
* in the browser or try to resolve WebSocket-compatible
|
||||
* interface exposed by `ws` for Node-like environment.
|
||||
*/
|
||||
|
||||
var WebSocket = BrowserWebSocket;
|
||||
if (!WebSocket && typeof window === 'undefined') {
|
||||
WebSocket = NodeWebSocket;
|
||||
}
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
*/
|
||||
|
||||
module.exports = WS;
|
||||
|
||||
/**
|
||||
* WebSocket transport constructor.
|
||||
*
|
||||
* @api {Object} connection options
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function WS (opts) {
|
||||
var forceBase64 = (opts && opts.forceBase64);
|
||||
if (forceBase64) {
|
||||
this.supportsBinary = false;
|
||||
}
|
||||
this.perMessageDeflate = opts.perMessageDeflate;
|
||||
this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode;
|
||||
if (!this.usingBrowserWebSocket) {
|
||||
WebSocket = NodeWebSocket;
|
||||
}
|
||||
Transport.call(this, opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inherits from Transport.
|
||||
*/
|
||||
|
||||
inherit(WS, Transport);
|
||||
|
||||
/**
|
||||
* Transport name.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
WS.prototype.name = 'websocket';
|
||||
|
||||
/*
|
||||
* WebSockets support binary
|
||||
*/
|
||||
|
||||
WS.prototype.supportsBinary = true;
|
||||
|
||||
/**
|
||||
* Opens socket.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
WS.prototype.doOpen = function () {
|
||||
if (!this.check()) {
|
||||
// let probe timeout
|
||||
return;
|
||||
}
|
||||
|
||||
var uri = this.uri();
|
||||
var protocols = void (0);
|
||||
var opts = {
|
||||
agent: this.agent,
|
||||
perMessageDeflate: this.perMessageDeflate
|
||||
};
|
||||
|
||||
// SSL options for Node.js client
|
||||
opts.pfx = this.pfx;
|
||||
opts.key = this.key;
|
||||
opts.passphrase = this.passphrase;
|
||||
opts.cert = this.cert;
|
||||
opts.ca = this.ca;
|
||||
opts.ciphers = this.ciphers;
|
||||
opts.rejectUnauthorized = this.rejectUnauthorized;
|
||||
if (this.extraHeaders) {
|
||||
opts.headers = this.extraHeaders;
|
||||
}
|
||||
if (this.localAddress) {
|
||||
opts.localAddress = this.localAddress;
|
||||
}
|
||||
|
||||
try {
|
||||
this.ws = this.usingBrowserWebSocket ? new WebSocket(uri) : new WebSocket(uri, protocols, opts);
|
||||
} catch (err) {
|
||||
return this.emit('error', err);
|
||||
}
|
||||
|
||||
if (this.ws.binaryType === undefined) {
|
||||
this.supportsBinary = false;
|
||||
}
|
||||
|
||||
if (this.ws.supports && this.ws.supports.binary) {
|
||||
this.supportsBinary = true;
|
||||
this.ws.binaryType = 'nodebuffer';
|
||||
} else {
|
||||
this.ws.binaryType = 'arraybuffer';
|
||||
}
|
||||
|
||||
this.addEventListeners();
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds event listeners to the socket
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
WS.prototype.addEventListeners = function () {
|
||||
var self = this;
|
||||
|
||||
this.ws.onopen = function () {
|
||||
self.onOpen();
|
||||
};
|
||||
this.ws.onclose = function () {
|
||||
self.onClose();
|
||||
};
|
||||
this.ws.onmessage = function (ev) {
|
||||
self.onData(ev.data);
|
||||
};
|
||||
this.ws.onerror = function (e) {
|
||||
self.onError('websocket error', e);
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Writes data to socket.
|
||||
*
|
||||
* @param {Array} array of packets.
|
||||
* @api private
|
||||
*/
|
||||
|
||||
WS.prototype.write = function (packets) {
|
||||
var self = this;
|
||||
this.writable = false;
|
||||
|
||||
// encodePacket efficient as it uses WS framing
|
||||
// no need for encodePayload
|
||||
var total = packets.length;
|
||||
for (var i = 0, l = total; i < l; i++) {
|
||||
(function (packet) {
|
||||
parser.encodePacket(packet, self.supportsBinary, function (data) {
|
||||
if (!self.usingBrowserWebSocket) {
|
||||
// always create a new object (GH-437)
|
||||
var opts = {};
|
||||
if (packet.options) {
|
||||
opts.compress = packet.options.compress;
|
||||
}
|
||||
|
||||
if (self.perMessageDeflate) {
|
||||
var len = 'string' === typeof data ? global.Buffer.byteLength(data) : data.length;
|
||||
if (len < self.perMessageDeflate.threshold) {
|
||||
opts.compress = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sometimes the websocket has already been closed but the browser didn't
|
||||
// have a chance of informing us about it yet, in that case send will
|
||||
// throw an error
|
||||
try {
|
||||
if (self.usingBrowserWebSocket) {
|
||||
// TypeError is thrown when passing the second argument on Safari
|
||||
self.ws.send(data);
|
||||
} else {
|
||||
self.ws.send(data, opts);
|
||||
}
|
||||
} catch (e) {
|
||||
debug('websocket closed before onclose event');
|
||||
}
|
||||
|
||||
--total || done();
|
||||
});
|
||||
})(packets[i]);
|
||||
}
|
||||
|
||||
function done () {
|
||||
self.emit('flush');
|
||||
|
||||
// fake drain
|
||||
// defer to next tick to allow Socket to clear writeBuffer
|
||||
setTimeout(function () {
|
||||
self.writable = true;
|
||||
self.emit('drain');
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Called upon close
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
WS.prototype.onClose = function () {
|
||||
Transport.prototype.onClose.call(this);
|
||||
};
|
||||
|
||||
/**
|
||||
* Closes socket.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
WS.prototype.doClose = function () {
|
||||
if (typeof this.ws !== 'undefined') {
|
||||
this.ws.close();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Generates uri for connection.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
WS.prototype.uri = function () {
|
||||
var query = this.query || {};
|
||||
var schema = this.secure ? 'wss' : 'ws';
|
||||
var port = '';
|
||||
|
||||
// avoid port if default for schema
|
||||
if (this.port && (('wss' === schema && Number(this.port) !== 443) ||
|
||||
('ws' === schema && Number(this.port) !== 80))) {
|
||||
port = ':' + this.port;
|
||||
}
|
||||
|
||||
// append timestamp to URI
|
||||
if (this.timestampRequests) {
|
||||
query[this.timestampParam] = yeast();
|
||||
}
|
||||
|
||||
// communicate binary support capabilities
|
||||
if (!this.supportsBinary) {
|
||||
query.b64 = 1;
|
||||
}
|
||||
|
||||
query = parseqs.encode(query);
|
||||
|
||||
// prepend ? to query
|
||||
if (query.length) {
|
||||
query = '?' + query;
|
||||
}
|
||||
|
||||
var ipv6 = this.hostname.indexOf(':') !== -1;
|
||||
return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
|
||||
};
|
||||
|
||||
/**
|
||||
* Feature detection for WebSocket.
|
||||
*
|
||||
* @return {Boolean} whether this transport is available.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
WS.prototype.check = function () {
|
||||
return !!WebSocket && !('__initialize' in WebSocket && this.name === WS.prototype.name);
|
||||
};
|
37
node_modules/engine.io-client/lib/xmlhttprequest.js
generated
vendored
Normal file
37
node_modules/engine.io-client/lib/xmlhttprequest.js
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
// browser shim for xmlhttprequest module
|
||||
|
||||
var hasCORS = require('has-cors');
|
||||
|
||||
module.exports = function (opts) {
|
||||
var xdomain = opts.xdomain;
|
||||
|
||||
// scheme must be same when usign XDomainRequest
|
||||
// http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
|
||||
var xscheme = opts.xscheme;
|
||||
|
||||
// XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.
|
||||
// https://github.com/Automattic/engine.io-client/pull/217
|
||||
var enablesXDR = opts.enablesXDR;
|
||||
|
||||
// XMLHttpRequest can be disabled on IE
|
||||
try {
|
||||
if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
|
||||
return new XMLHttpRequest();
|
||||
}
|
||||
} catch (e) { }
|
||||
|
||||
// Use XDomainRequest for IE8 if enablesXDR is true
|
||||
// because loading bar keeps flashing when using jsonp-polling
|
||||
// https://github.com/yujiosaka/socke.io-ie8-loading-example
|
||||
try {
|
||||
if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) {
|
||||
return new XDomainRequest();
|
||||
}
|
||||
} catch (e) { }
|
||||
|
||||
if (!xdomain) {
|
||||
try {
|
||||
return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP');
|
||||
} catch (e) { }
|
||||
}
|
||||
};
|
68
node_modules/engine.io-client/node_modules/component-emitter/History.md
generated
vendored
Normal file
68
node_modules/engine.io-client/node_modules/component-emitter/History.md
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
|
||||
1.2.1 / 2016-04-18
|
||||
==================
|
||||
|
||||
* enable client side use
|
||||
|
||||
1.2.0 / 2014-02-12
|
||||
==================
|
||||
|
||||
* prefix events with `$` to support object prototype method names
|
||||
|
||||
1.1.3 / 2014-06-20
|
||||
==================
|
||||
|
||||
* republish for npm
|
||||
* add LICENSE file
|
||||
|
||||
1.1.2 / 2014-02-10
|
||||
==================
|
||||
|
||||
* package: rename to "component-emitter"
|
||||
* package: update "main" and "component" fields
|
||||
* Add license to Readme (same format as the other components)
|
||||
* created .npmignore
|
||||
* travis stuff
|
||||
|
||||
1.1.1 / 2013-12-01
|
||||
==================
|
||||
|
||||
* fix .once adding .on to the listener
|
||||
* docs: Emitter#off()
|
||||
* component: add `.repo` prop
|
||||
|
||||
1.1.0 / 2013-10-20
|
||||
==================
|
||||
|
||||
* add `.addEventListener()` and `.removeEventListener()` aliases
|
||||
|
||||
1.0.1 / 2013-06-27
|
||||
==================
|
||||
|
||||
* add support for legacy ie
|
||||
|
||||
1.0.0 / 2013-02-26
|
||||
==================
|
||||
|
||||
* add `.off()` support for removing all listeners
|
||||
|
||||
0.0.6 / 2012-10-08
|
||||
==================
|
||||
|
||||
* add `this._callbacks` initialization to prevent funky gotcha
|
||||
|
||||
0.0.5 / 2012-09-07
|
||||
==================
|
||||
|
||||
* fix `Emitter.call(this)` usage
|
||||
|
||||
0.0.3 / 2012-07-11
|
||||
==================
|
||||
|
||||
* add `.listeners()`
|
||||
* rename `.has()` to `.hasListeners()`
|
||||
|
||||
0.0.2 / 2012-06-28
|
||||
==================
|
||||
|
||||
* fix `.off()` with `.once()`-registered callbacks
|
24
node_modules/engine.io-client/node_modules/component-emitter/LICENSE
generated
vendored
Normal file
24
node_modules/engine.io-client/node_modules/component-emitter/LICENSE
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 Component contributors <dev@component.io>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
74
node_modules/engine.io-client/node_modules/component-emitter/Readme.md
generated
vendored
Normal file
74
node_modules/engine.io-client/node_modules/component-emitter/Readme.md
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
# Emitter [](https://travis-ci.org/component/emitter)
|
||||
|
||||
Event emitter component.
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
$ component install component/emitter
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### Emitter(obj)
|
||||
|
||||
The `Emitter` may also be used as a mixin. For example
|
||||
a "plain" object may become an emitter, or you may
|
||||
extend an existing prototype.
|
||||
|
||||
As an `Emitter` instance:
|
||||
|
||||
```js
|
||||
var Emitter = require('emitter');
|
||||
var emitter = new Emitter;
|
||||
emitter.emit('something');
|
||||
```
|
||||
|
||||
As a mixin:
|
||||
|
||||
```js
|
||||
var Emitter = require('emitter');
|
||||
var user = { name: 'tobi' };
|
||||
Emitter(user);
|
||||
|
||||
user.emit('im a user');
|
||||
```
|
||||
|
||||
As a prototype mixin:
|
||||
|
||||
```js
|
||||
var Emitter = require('emitter');
|
||||
Emitter(User.prototype);
|
||||
```
|
||||
|
||||
### Emitter#on(event, fn)
|
||||
|
||||
Register an `event` handler `fn`.
|
||||
|
||||
### Emitter#once(event, fn)
|
||||
|
||||
Register a single-shot `event` handler `fn`,
|
||||
removed immediately after it is invoked the
|
||||
first time.
|
||||
|
||||
### Emitter#off(event, fn)
|
||||
|
||||
* Pass `event` and `fn` to remove a listener.
|
||||
* Pass `event` to remove all listeners on that event.
|
||||
* Pass nothing to remove all listeners on all events.
|
||||
|
||||
### Emitter#emit(event, ...)
|
||||
|
||||
Emit an `event` with variable option args.
|
||||
|
||||
### Emitter#listeners(event)
|
||||
|
||||
Return an array of callbacks, or an empty array.
|
||||
|
||||
### Emitter#hasListeners(event)
|
||||
|
||||
Check if this emitter has `event` handlers.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
163
node_modules/engine.io-client/node_modules/component-emitter/index.js
generated
vendored
Normal file
163
node_modules/engine.io-client/node_modules/component-emitter/index.js
generated
vendored
Normal file
@ -0,0 +1,163 @@
|
||||
|
||||
/**
|
||||
* Expose `Emitter`.
|
||||
*/
|
||||
|
||||
if (typeof module !== 'undefined') {
|
||||
module.exports = Emitter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize a new `Emitter`.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function Emitter(obj) {
|
||||
if (obj) return mixin(obj);
|
||||
};
|
||||
|
||||
/**
|
||||
* Mixin the emitter properties.
|
||||
*
|
||||
* @param {Object} obj
|
||||
* @return {Object}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function mixin(obj) {
|
||||
for (var key in Emitter.prototype) {
|
||||
obj[key] = Emitter.prototype[key];
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen on the given `event` with `fn`.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Function} fn
|
||||
* @return {Emitter}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.on =
|
||||
Emitter.prototype.addEventListener = function(event, fn){
|
||||
this._callbacks = this._callbacks || {};
|
||||
(this._callbacks['$' + event] = this._callbacks['$' + event] || [])
|
||||
.push(fn);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds an `event` listener that will be invoked a single
|
||||
* time then automatically removed.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Function} fn
|
||||
* @return {Emitter}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.once = function(event, fn){
|
||||
function on() {
|
||||
this.off(event, on);
|
||||
fn.apply(this, arguments);
|
||||
}
|
||||
|
||||
on.fn = fn;
|
||||
this.on(event, on);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Remove the given callback for `event` or all
|
||||
* registered callbacks.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Function} fn
|
||||
* @return {Emitter}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.off =
|
||||
Emitter.prototype.removeListener =
|
||||
Emitter.prototype.removeAllListeners =
|
||||
Emitter.prototype.removeEventListener = function(event, fn){
|
||||
this._callbacks = this._callbacks || {};
|
||||
|
||||
// all
|
||||
if (0 == arguments.length) {
|
||||
this._callbacks = {};
|
||||
return this;
|
||||
}
|
||||
|
||||
// specific event
|
||||
var callbacks = this._callbacks['$' + event];
|
||||
if (!callbacks) return this;
|
||||
|
||||
// remove all handlers
|
||||
if (1 == arguments.length) {
|
||||
delete this._callbacks['$' + event];
|
||||
return this;
|
||||
}
|
||||
|
||||
// remove specific handler
|
||||
var cb;
|
||||
for (var i = 0; i < callbacks.length; i++) {
|
||||
cb = callbacks[i];
|
||||
if (cb === fn || cb.fn === fn) {
|
||||
callbacks.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Emit `event` with the given args.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Mixed} ...
|
||||
* @return {Emitter}
|
||||
*/
|
||||
|
||||
Emitter.prototype.emit = function(event){
|
||||
this._callbacks = this._callbacks || {};
|
||||
var args = [].slice.call(arguments, 1)
|
||||
, callbacks = this._callbacks['$' + event];
|
||||
|
||||
if (callbacks) {
|
||||
callbacks = callbacks.slice(0);
|
||||
for (var i = 0, len = callbacks.length; i < len; ++i) {
|
||||
callbacks[i].apply(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return array of callbacks for `event`.
|
||||
*
|
||||
* @param {String} event
|
||||
* @return {Array}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.listeners = function(event){
|
||||
this._callbacks = this._callbacks || {};
|
||||
return this._callbacks['$' + event] || [];
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if this emitter has `event` handlers.
|
||||
*
|
||||
* @param {String} event
|
||||
* @return {Boolean}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.hasListeners = function(event){
|
||||
return !! this.listeners(event).length;
|
||||
};
|
207
node_modules/engine.io-client/node_modules/component-emitter/package.json
generated
vendored
Normal file
207
node_modules/engine.io-client/node_modules/component-emitter/package.json
generated
vendored
Normal file
@ -0,0 +1,207 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"component-emitter@1.2.1",
|
||||
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\engine.io-client"
|
||||
]
|
||||
],
|
||||
"_from": "component-emitter@1.2.1",
|
||||
"_id": "component-emitter@1.2.1",
|
||||
"_inCache": true,
|
||||
"_location": "/engine.io-client/component-emitter",
|
||||
"_nodeVersion": "0.12.4",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/component-emitter-1.2.1.tgz_1461005707641_0.14232611074112356"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "karp@hotmail.fr",
|
||||
"name": "nami-doc"
|
||||
},
|
||||
"_npmVersion": "2.10.1",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "component-emitter",
|
||||
"raw": "component-emitter@1.2.1",
|
||||
"rawSpec": "1.2.1",
|
||||
"scope": null,
|
||||
"spec": "1.2.1",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/engine.io-client"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz",
|
||||
"_shasum": "137918d6d78283f7df7a6b7c5a63e140e69425e6",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "component-emitter@1.2.1",
|
||||
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\engine.io-client",
|
||||
"bugs": {
|
||||
"url": "https://github.com/component/emitter/issues"
|
||||
},
|
||||
"component": {
|
||||
"scripts": {
|
||||
"emitter/index.js": "index.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Event emitter",
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"should": "*"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "137918d6d78283f7df7a6b7c5a63e140e69425e6",
|
||||
"tarball": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "187492ab8028c7221b589bdfd482b715149cd868",
|
||||
"homepage": "https://github.com/component/emitter#readme",
|
||||
"installable": true,
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "swatinem",
|
||||
"email": "arpad.borsos@googlemail.com"
|
||||
},
|
||||
{
|
||||
"name": "tootallnate",
|
||||
"email": "nathan@tootallnate.net"
|
||||
},
|
||||
{
|
||||
"name": "trevorgerhardt",
|
||||
"email": "trevorgerhardt@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "timaschew",
|
||||
"email": "timaschew@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "tjholowaychuk",
|
||||
"email": "tj@vision-media.ca"
|
||||
},
|
||||
{
|
||||
"name": "rauchg",
|
||||
"email": "rauchg@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "retrofox",
|
||||
"email": "rdsuarez@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "coreh",
|
||||
"email": "thecoreh@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "forbeslindesay",
|
||||
"email": "forbes@lindesay.co.uk"
|
||||
},
|
||||
{
|
||||
"name": "kelonye",
|
||||
"email": "kelonyemitchel@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "mattmueller",
|
||||
"email": "mattmuelle@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "yields",
|
||||
"email": "yields@icloud.com"
|
||||
},
|
||||
{
|
||||
"name": "anthonyshort",
|
||||
"email": "antshort@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "jongleberry",
|
||||
"email": "jonathanrichardong@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "ianstormtaylor",
|
||||
"email": "ian@ianstormtaylor.com"
|
||||
},
|
||||
{
|
||||
"name": "cristiandouce",
|
||||
"email": "cristian@gravityonmars.com"
|
||||
},
|
||||
{
|
||||
"name": "hughsk",
|
||||
"email": "hughskennedy@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "stagas",
|
||||
"email": "gstagas@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "amasad",
|
||||
"email": "amjad.masad@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "juliangruber",
|
||||
"email": "julian@juliangruber.com"
|
||||
},
|
||||
{
|
||||
"name": "calvinfo",
|
||||
"email": "calvin@calv.info"
|
||||
},
|
||||
{
|
||||
"name": "dominicbarnes",
|
||||
"email": "dominic@dbarnes.info"
|
||||
},
|
||||
{
|
||||
"name": "blakeembrey",
|
||||
"email": "hello@blakeembrey.com"
|
||||
},
|
||||
{
|
||||
"name": "timoxley",
|
||||
"email": "secoif@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "jonathanong",
|
||||
"email": "jonathanrichardong@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "queckezz",
|
||||
"email": "fabian.eichenberger@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "nami-doc",
|
||||
"email": "vendethiel@hotmail.fr"
|
||||
},
|
||||
{
|
||||
"name": "clintwood",
|
||||
"email": "clint@anotherway.co.za"
|
||||
},
|
||||
{
|
||||
"name": "thehydroimpulse",
|
||||
"email": "dnfagnan@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "stephenmathieson",
|
||||
"email": "me@stephenmathieson.com"
|
||||
},
|
||||
{
|
||||
"name": "dfcreative",
|
||||
"email": "df.creative@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "defunctzombie",
|
||||
"email": "shtylman@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "component-emitter",
|
||||
"optionalDependencies": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/component/emitter.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
},
|
||||
"version": "1.2.1"
|
||||
}
|
3
node_modules/engine.io-client/node_modules/debug/.jshintrc
generated
vendored
Normal file
3
node_modules/engine.io-client/node_modules/debug/.jshintrc
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"laxbreak": true
|
||||
}
|
7
node_modules/engine.io-client/node_modules/debug/.npmignore
generated
vendored
Normal file
7
node_modules/engine.io-client/node_modules/debug/.npmignore
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
support
|
||||
test
|
||||
examples
|
||||
example
|
||||
*.sock
|
||||
dist
|
||||
yarn.lock
|
235
node_modules/engine.io-client/node_modules/debug/CHANGELOG.md
generated
vendored
Normal file
235
node_modules/engine.io-client/node_modules/debug/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,235 @@
|
||||
2.3.3 / 2016-11-09
|
||||
==================
|
||||
|
||||
* Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne)
|
||||
* Fix: Returning `localStorage` saved values (#331, Levi Thomason)
|
||||
* Improvement: Don't create an empty object when no `process` (Nathan Rajlich)
|
||||
|
||||
2.3.2 / 2016-11-09
|
||||
==================
|
||||
|
||||
* Fix: be super-safe in index.js as well (@TooTallNate)
|
||||
* Fix: should check whether process exists (Tom Newby)
|
||||
|
||||
2.3.1 / 2016-11-09
|
||||
==================
|
||||
|
||||
* Fix: Added electron compatibility (#324, @paulcbetts)
|
||||
* Improvement: Added performance optimizations (@tootallnate)
|
||||
* Readme: Corrected PowerShell environment variable example (#252, @gimre)
|
||||
* Misc: Removed yarn lock file from source control (#321, @fengmk2)
|
||||
|
||||
2.3.0 / 2016-11-07
|
||||
==================
|
||||
|
||||
* Fix: Consistent placement of ms diff at end of output (#215, @gorangajic)
|
||||
* Fix: Escaping of regex special characters in namespace strings (#250, @zacronos)
|
||||
* Fix: Fixed bug causing crash on react-native (#282, @vkarpov15)
|
||||
* Feature: Enabled ES6+ compatible import via default export (#212 @bucaran)
|
||||
* Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom)
|
||||
* Package: Update "ms" to 0.7.2 (#315, @DevSide)
|
||||
* Package: removed superfluous version property from bower.json (#207 @kkirsche)
|
||||
* Readme: fix USE_COLORS to DEBUG_COLORS
|
||||
* Readme: Doc fixes for format string sugar (#269, @mlucool)
|
||||
* Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0)
|
||||
* Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable)
|
||||
* Readme: better docs for browser support (#224, @matthewmueller)
|
||||
* Tooling: Added yarn integration for development (#317, @thebigredgeek)
|
||||
* Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek)
|
||||
* Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman)
|
||||
* Misc: Updated contributors (@thebigredgeek)
|
||||
|
||||
2.2.0 / 2015-05-09
|
||||
==================
|
||||
|
||||
* package: update "ms" to v0.7.1 (#202, @dougwilson)
|
||||
* README: add logging to file example (#193, @DanielOchoa)
|
||||
* README: fixed a typo (#191, @amir-s)
|
||||
* browser: expose `storage` (#190, @stephenmathieson)
|
||||
* Makefile: add a `distclean` target (#189, @stephenmathieson)
|
||||
|
||||
2.1.3 / 2015-03-13
|
||||
==================
|
||||
|
||||
* Updated stdout/stderr example (#186)
|
||||
* Updated example/stdout.js to match debug current behaviour
|
||||
* Renamed example/stderr.js to stdout.js
|
||||
* Update Readme.md (#184)
|
||||
* replace high intensity foreground color for bold (#182, #183)
|
||||
|
||||
2.1.2 / 2015-03-01
|
||||
==================
|
||||
|
||||
* dist: recompile
|
||||
* update "ms" to v0.7.0
|
||||
* package: update "browserify" to v9.0.3
|
||||
* component: fix "ms.js" repo location
|
||||
* changed bower package name
|
||||
* updated documentation about using debug in a browser
|
||||
* fix: security error on safari (#167, #168, @yields)
|
||||
|
||||
2.1.1 / 2014-12-29
|
||||
==================
|
||||
|
||||
* browser: use `typeof` to check for `console` existence
|
||||
* browser: check for `console.log` truthiness (fix IE 8/9)
|
||||
* browser: add support for Chrome apps
|
||||
* Readme: added Windows usage remarks
|
||||
* Add `bower.json` to properly support bower install
|
||||
|
||||
2.1.0 / 2014-10-15
|
||||
==================
|
||||
|
||||
* node: implement `DEBUG_FD` env variable support
|
||||
* package: update "browserify" to v6.1.0
|
||||
* package: add "license" field to package.json (#135, @panuhorsmalahti)
|
||||
|
||||
2.0.0 / 2014-09-01
|
||||
==================
|
||||
|
||||
* package: update "browserify" to v5.11.0
|
||||
* node: use stderr rather than stdout for logging (#29, @stephenmathieson)
|
||||
|
||||
1.0.4 / 2014-07-15
|
||||
==================
|
||||
|
||||
* dist: recompile
|
||||
* example: remove `console.info()` log usage
|
||||
* example: add "Content-Type" UTF-8 header to browser example
|
||||
* browser: place %c marker after the space character
|
||||
* browser: reset the "content" color via `color: inherit`
|
||||
* browser: add colors support for Firefox >= v31
|
||||
* debug: prefer an instance `log()` function over the global one (#119)
|
||||
* Readme: update documentation about styled console logs for FF v31 (#116, @wryk)
|
||||
|
||||
1.0.3 / 2014-07-09
|
||||
==================
|
||||
|
||||
* Add support for multiple wildcards in namespaces (#122, @seegno)
|
||||
* browser: fix lint
|
||||
|
||||
1.0.2 / 2014-06-10
|
||||
==================
|
||||
|
||||
* browser: update color palette (#113, @gscottolson)
|
||||
* common: make console logging function configurable (#108, @timoxley)
|
||||
* node: fix %o colors on old node <= 0.8.x
|
||||
* Makefile: find node path using shell/which (#109, @timoxley)
|
||||
|
||||
1.0.1 / 2014-06-06
|
||||
==================
|
||||
|
||||
* browser: use `removeItem()` to clear localStorage
|
||||
* browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)
|
||||
* package: add "contributors" section
|
||||
* node: fix comment typo
|
||||
* README: list authors
|
||||
|
||||
1.0.0 / 2014-06-04
|
||||
==================
|
||||
|
||||
* make ms diff be global, not be scope
|
||||
* debug: ignore empty strings in enable()
|
||||
* node: make DEBUG_COLORS able to disable coloring
|
||||
* *: export the `colors` array
|
||||
* npmignore: don't publish the `dist` dir
|
||||
* Makefile: refactor to use browserify
|
||||
* package: add "browserify" as a dev dependency
|
||||
* Readme: add Web Inspector Colors section
|
||||
* node: reset terminal color for the debug content
|
||||
* node: map "%o" to `util.inspect()`
|
||||
* browser: map "%j" to `JSON.stringify()`
|
||||
* debug: add custom "formatters"
|
||||
* debug: use "ms" module for humanizing the diff
|
||||
* Readme: add "bash" syntax highlighting
|
||||
* browser: add Firebug color support
|
||||
* browser: add colors for WebKit browsers
|
||||
* node: apply log to `console`
|
||||
* rewrite: abstract common logic for Node & browsers
|
||||
* add .jshintrc file
|
||||
|
||||
0.8.1 / 2014-04-14
|
||||
==================
|
||||
|
||||
* package: re-add the "component" section
|
||||
|
||||
0.8.0 / 2014-03-30
|
||||
==================
|
||||
|
||||
* add `enable()` method for nodejs. Closes #27
|
||||
* change from stderr to stdout
|
||||
* remove unnecessary index.js file
|
||||
|
||||
0.7.4 / 2013-11-13
|
||||
==================
|
||||
|
||||
* remove "browserify" key from package.json (fixes something in browserify)
|
||||
|
||||
0.7.3 / 2013-10-30
|
||||
==================
|
||||
|
||||
* fix: catch localStorage security error when cookies are blocked (Chrome)
|
||||
* add debug(err) support. Closes #46
|
||||
* add .browser prop to package.json. Closes #42
|
||||
|
||||
0.7.2 / 2013-02-06
|
||||
==================
|
||||
|
||||
* fix package.json
|
||||
* fix: Mobile Safari (private mode) is broken with debug
|
||||
* fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
|
||||
|
||||
0.7.1 / 2013-02-05
|
||||
==================
|
||||
|
||||
* add repository URL to package.json
|
||||
* add DEBUG_COLORED to force colored output
|
||||
* add browserify support
|
||||
* fix component. Closes #24
|
||||
|
||||
0.7.0 / 2012-05-04
|
||||
==================
|
||||
|
||||
* Added .component to package.json
|
||||
* Added debug.component.js build
|
||||
|
||||
0.6.0 / 2012-03-16
|
||||
==================
|
||||
|
||||
* Added support for "-" prefix in DEBUG [Vinay Pulim]
|
||||
* Added `.enabled` flag to the node version [TooTallNate]
|
||||
|
||||
0.5.0 / 2012-02-02
|
||||
==================
|
||||
|
||||
* Added: humanize diffs. Closes #8
|
||||
* Added `debug.disable()` to the CS variant
|
||||
* Removed padding. Closes #10
|
||||
* Fixed: persist client-side variant again. Closes #9
|
||||
|
||||
0.4.0 / 2012-02-01
|
||||
==================
|
||||
|
||||
* Added browser variant support for older browsers [TooTallNate]
|
||||
* Added `debug.enable('project:*')` to browser variant [TooTallNate]
|
||||
* Added padding to diff (moved it to the right)
|
||||
|
||||
0.3.0 / 2012-01-26
|
||||
==================
|
||||
|
||||
* Added millisecond diff when isatty, otherwise UTC string
|
||||
|
||||
0.2.0 / 2012-01-22
|
||||
==================
|
||||
|
||||
* Added wildcard support
|
||||
|
||||
0.1.0 / 2011-12-02
|
||||
==================
|
||||
|
||||
* Added: remove colors unless stderr isatty [TooTallNate]
|
||||
|
||||
0.0.1 / 2010-01-03
|
||||
==================
|
||||
|
||||
* Initial release
|
19
node_modules/engine.io-client/node_modules/debug/LICENSE
generated
vendored
Normal file
19
node_modules/engine.io-client/node_modules/debug/LICENSE
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||
and associated documentation files (the 'Software'), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial
|
||||
portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
37
node_modules/engine.io-client/node_modules/debug/Makefile
generated
vendored
Normal file
37
node_modules/engine.io-client/node_modules/debug/Makefile
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
|
||||
# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
|
||||
THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
||||
THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
|
||||
|
||||
# BIN directory
|
||||
BIN := $(THIS_DIR)/node_modules/.bin
|
||||
|
||||
# applications
|
||||
NODE ?= $(shell which node)
|
||||
YARN ?= $(shell which yarn)
|
||||
PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))
|
||||
BROWSERIFY ?= $(NODE) $(BIN)/browserify
|
||||
|
||||
all: dist/debug.js
|
||||
|
||||
install: node_modules
|
||||
|
||||
clean:
|
||||
@rm -rf dist
|
||||
|
||||
dist:
|
||||
@mkdir -p $@
|
||||
|
||||
dist/debug.js: node_modules browser.js debug.js dist
|
||||
@$(BROWSERIFY) \
|
||||
--standalone debug \
|
||||
. > $@
|
||||
|
||||
distclean: clean
|
||||
@rm -rf node_modules
|
||||
|
||||
node_modules: package.json
|
||||
@NODE_ENV= $(PKG) install
|
||||
@touch node_modules
|
||||
|
||||
.PHONY: all install clean distclean
|
199
node_modules/engine.io-client/node_modules/debug/Readme.md
generated
vendored
Normal file
199
node_modules/engine.io-client/node_modules/debug/Readme.md
generated
vendored
Normal file
@ -0,0 +1,199 @@
|
||||
# debug
|
||||
|
||||
tiny node.js debugging utility modelled after node core's debugging technique.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
$ npm install debug
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` [format string goodies](https://developer.chrome.com/devtools/docs/console-api#consolelogobject-object) you're used to work fine. A unique color is selected per-function for visibility.
|
||||
|
||||
Example _app.js_:
|
||||
|
||||
```js
|
||||
var debug = require('debug')('http')
|
||||
, http = require('http')
|
||||
, name = 'My App';
|
||||
|
||||
// fake app
|
||||
|
||||
debug('booting %s', name);
|
||||
|
||||
http.createServer(function(req, res){
|
||||
debug(req.method + ' ' + req.url);
|
||||
res.end('hello\n');
|
||||
}).listen(3000, function(){
|
||||
debug('listening');
|
||||
});
|
||||
|
||||
// fake worker of some kind
|
||||
|
||||
require('./worker');
|
||||
```
|
||||
|
||||
Example _worker.js_:
|
||||
|
||||
```js
|
||||
var debug = require('debug')('worker');
|
||||
|
||||
setInterval(function(){
|
||||
debug('doing some work');
|
||||
}, 1000);
|
||||
```
|
||||
|
||||
The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
#### Windows note
|
||||
|
||||
On Windows the environment variable is set using the `set` command.
|
||||
|
||||
```cmd
|
||||
set DEBUG=*,-not_this
|
||||
```
|
||||
|
||||
Note that PowerShell using different syntax to set environment variables.
|
||||
|
||||
```cmd
|
||||
$env:DEBUG = "*,-not_this"
|
||||
```
|
||||
|
||||
Then, run the program to be debugged as usual.
|
||||
|
||||
## Millisecond diff
|
||||
|
||||
When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
|
||||
|
||||

|
||||
|
||||
When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
|
||||
|
||||

|
||||
|
||||
## Conventions
|
||||
|
||||
If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".
|
||||
|
||||
## Wildcards
|
||||
|
||||
The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
|
||||
|
||||
You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:".
|
||||
|
||||
## Browser support
|
||||
|
||||
Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. You can enable this using `localStorage.debug`:
|
||||
|
||||
```js
|
||||
localStorage.debug = 'worker:*'
|
||||
```
|
||||
|
||||
And then refresh the page.
|
||||
|
||||
```js
|
||||
a = debug('worker:a');
|
||||
b = debug('worker:b');
|
||||
|
||||
setInterval(function(){
|
||||
a('doing some work');
|
||||
}, 1000);
|
||||
|
||||
setInterval(function(){
|
||||
b('doing some work');
|
||||
}, 1200);
|
||||
```
|
||||
|
||||
#### Web Inspector Colors
|
||||
|
||||
Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
|
||||
option. These are WebKit web inspectors, Firefox ([since version
|
||||
31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
|
||||
and the Firebug plugin for Firefox (any version).
|
||||
|
||||
Colored output looks something like:
|
||||
|
||||

|
||||
|
||||
## Output streams
|
||||
|
||||
|
||||
### stderr vs stdout
|
||||
By default `debug` will log to stderr, however this can be changed by setting the environment variable `DEBUG_FD` to `1` for stdout and `2` for stderr (the default value).
|
||||
|
||||
You can also set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally:
|
||||
|
||||
Example _stdout.js_:
|
||||
|
||||
```js
|
||||
var debug = require('debug');
|
||||
var error = debug('app:error');
|
||||
|
||||
// by default stderr is used
|
||||
error('goes to stderr!');
|
||||
|
||||
var log = debug('app:log');
|
||||
// set this namespace to log via console.log
|
||||
log.log = console.log.bind(console); // don't forget to bind to console!
|
||||
log('goes to stdout');
|
||||
error('still goes to stderr!');
|
||||
|
||||
// set all output to go via console.info
|
||||
// overrides all per-namespace log settings
|
||||
debug.log = console.info.bind(console);
|
||||
error('now goes to stdout via console.info');
|
||||
log('still goes to stdout, but via console.info now');
|
||||
```
|
||||
|
||||
### Save debug output to a file
|
||||
|
||||
You can save all debug statements to a file by piping them.
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
$ DEBUG_FD=3 node your-app.js 3> whatever.log
|
||||
```
|
||||
|
||||
### Terminal colors
|
||||
|
||||
By default colors will only be used in a TTY. However this can be overridden by setting the environment variable `DEBUG_COLORS` to `1`.
|
||||
|
||||
Note: Certain IDEs (such as WebStorm) don't support colors on stderr. In these cases you must set `DEBUG_COLORS` to `1` and additionally change `DEBUG_FD` to `1`.
|
||||
|
||||
## Authors
|
||||
|
||||
- TJ Holowaychuk
|
||||
- Nathan Rajlich
|
||||
- Andrew Rhyne
|
||||
|
||||
## License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014-2016 TJ Holowaychuk <tj@vision-media.ca>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
29
node_modules/engine.io-client/node_modules/debug/bower.json
generated
vendored
Normal file
29
node_modules/engine.io-client/node_modules/debug/bower.json
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "visionmedia-debug",
|
||||
"main": "dist/debug.js",
|
||||
"homepage": "https://github.com/visionmedia/debug",
|
||||
"authors": [
|
||||
"TJ Holowaychuk <tj@vision-media.ca>",
|
||||
"Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)",
|
||||
"Andrew Rhyne <rhyneandrew@gmail.com>"
|
||||
],
|
||||
"description": "visionmedia-debug",
|
||||
"moduleType": [
|
||||
"amd",
|
||||
"es6",
|
||||
"globals",
|
||||
"node"
|
||||
],
|
||||
"keywords": [
|
||||
"visionmedia",
|
||||
"debug"
|
||||
],
|
||||
"license": "MIT",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
]
|
||||
}
|
177
node_modules/engine.io-client/node_modules/debug/browser.js
generated
vendored
Normal file
177
node_modules/engine.io-client/node_modules/debug/browser.js
generated
vendored
Normal file
@ -0,0 +1,177 @@
|
||||
|
||||
/**
|
||||
* This is the web browser implementation of `debug()`.
|
||||
*
|
||||
* Expose `debug()` as the module.
|
||||
*/
|
||||
|
||||
exports = module.exports = require('./debug');
|
||||
exports.log = log;
|
||||
exports.formatArgs = formatArgs;
|
||||
exports.save = save;
|
||||
exports.load = load;
|
||||
exports.useColors = useColors;
|
||||
exports.storage = 'undefined' != typeof chrome
|
||||
&& 'undefined' != typeof chrome.storage
|
||||
? chrome.storage.local
|
||||
: localstorage();
|
||||
|
||||
/**
|
||||
* Colors.
|
||||
*/
|
||||
|
||||
exports.colors = [
|
||||
'lightseagreen',
|
||||
'forestgreen',
|
||||
'goldenrod',
|
||||
'dodgerblue',
|
||||
'darkorchid',
|
||||
'crimson'
|
||||
];
|
||||
|
||||
/**
|
||||
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
||||
* and the Firebug extension (any Firefox version) are known
|
||||
* to support "%c" CSS customizations.
|
||||
*
|
||||
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
||||
*/
|
||||
|
||||
function useColors() {
|
||||
// is webkit? http://stackoverflow.com/a/16459606/376773
|
||||
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
||||
return (typeof document !== 'undefined' && 'WebkitAppearance' in document.documentElement.style) ||
|
||||
// is firebug? http://stackoverflow.com/a/398120/376773
|
||||
(window.console && (console.firebug || (console.exception && console.table))) ||
|
||||
// is firefox >= v31?
|
||||
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
||||
(navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31);
|
||||
}
|
||||
|
||||
/**
|
||||
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
||||
*/
|
||||
|
||||
exports.formatters.j = function(v) {
|
||||
try {
|
||||
return JSON.stringify(v);
|
||||
} catch (err) {
|
||||
return '[UnexpectedJSONParseError]: ' + err.message;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Colorize log arguments if enabled.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function formatArgs() {
|
||||
var args = arguments;
|
||||
var useColors = this.useColors;
|
||||
|
||||
args[0] = (useColors ? '%c' : '')
|
||||
+ this.namespace
|
||||
+ (useColors ? ' %c' : ' ')
|
||||
+ args[0]
|
||||
+ (useColors ? '%c ' : ' ')
|
||||
+ '+' + exports.humanize(this.diff);
|
||||
|
||||
if (!useColors) return args;
|
||||
|
||||
var c = 'color: ' + this.color;
|
||||
args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));
|
||||
|
||||
// the final "%c" is somewhat tricky, because there could be other
|
||||
// arguments passed either before or after the %c, so we need to
|
||||
// figure out the correct index to insert the CSS into
|
||||
var index = 0;
|
||||
var lastC = 0;
|
||||
args[0].replace(/%[a-z%]/g, function(match) {
|
||||
if ('%%' === match) return;
|
||||
index++;
|
||||
if ('%c' === match) {
|
||||
// we only are interested in the *last* %c
|
||||
// (the user may have provided their own)
|
||||
lastC = index;
|
||||
}
|
||||
});
|
||||
|
||||
args.splice(lastC, 0, c);
|
||||
return args;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes `console.log()` when available.
|
||||
* No-op when `console.log` is not a "function".
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function log() {
|
||||
// this hackery is required for IE8/9, where
|
||||
// the `console.log` function doesn't have 'apply'
|
||||
return 'object' === typeof console
|
||||
&& console.log
|
||||
&& Function.prototype.apply.call(console.log, console, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save `namespaces`.
|
||||
*
|
||||
* @param {String} namespaces
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function save(namespaces) {
|
||||
try {
|
||||
if (null == namespaces) {
|
||||
exports.storage.removeItem('debug');
|
||||
} else {
|
||||
exports.storage.debug = namespaces;
|
||||
}
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load `namespaces`.
|
||||
*
|
||||
* @return {String} returns the previously persisted debug modes
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function load() {
|
||||
var r;
|
||||
try {
|
||||
return exports.storage.debug;
|
||||
} catch(e) {}
|
||||
|
||||
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
||||
if (typeof process !== 'undefined' && 'env' in process) {
|
||||
return process.env.DEBUG;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable namespaces listed in `localStorage.debug` initially.
|
||||
*/
|
||||
|
||||
exports.enable(load());
|
||||
|
||||
/**
|
||||
* Localstorage attempts to return the localstorage.
|
||||
*
|
||||
* This is necessary because safari throws
|
||||
* when a user disables cookies/localstorage
|
||||
* and you attempt to access it.
|
||||
*
|
||||
* @return {LocalStorage}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function localstorage(){
|
||||
try {
|
||||
return window.localStorage;
|
||||
} catch (e) {}
|
||||
}
|
19
node_modules/engine.io-client/node_modules/debug/component.json
generated
vendored
Normal file
19
node_modules/engine.io-client/node_modules/debug/component.json
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "debug",
|
||||
"repo": "visionmedia/debug",
|
||||
"description": "small debugging utility",
|
||||
"version": "2.3.3",
|
||||
"keywords": [
|
||||
"debug",
|
||||
"log",
|
||||
"debugger"
|
||||
],
|
||||
"main": "browser.js",
|
||||
"scripts": [
|
||||
"browser.js",
|
||||
"debug.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"rauchg/ms.js": "0.7.1"
|
||||
}
|
||||
}
|
200
node_modules/engine.io-client/node_modules/debug/debug.js
generated
vendored
Normal file
200
node_modules/engine.io-client/node_modules/debug/debug.js
generated
vendored
Normal file
@ -0,0 +1,200 @@
|
||||
|
||||
/**
|
||||
* This is the common logic for both the Node.js and web browser
|
||||
* implementations of `debug()`.
|
||||
*
|
||||
* Expose `debug()` as the module.
|
||||
*/
|
||||
|
||||
exports = module.exports = debug.debug = debug;
|
||||
exports.coerce = coerce;
|
||||
exports.disable = disable;
|
||||
exports.enable = enable;
|
||||
exports.enabled = enabled;
|
||||
exports.humanize = require('ms');
|
||||
|
||||
/**
|
||||
* The currently active debug mode names, and names to skip.
|
||||
*/
|
||||
|
||||
exports.names = [];
|
||||
exports.skips = [];
|
||||
|
||||
/**
|
||||
* Map of special "%n" handling functions, for the debug "format" argument.
|
||||
*
|
||||
* Valid key names are a single, lowercased letter, i.e. "n".
|
||||
*/
|
||||
|
||||
exports.formatters = {};
|
||||
|
||||
/**
|
||||
* Previously assigned color.
|
||||
*/
|
||||
|
||||
var prevColor = 0;
|
||||
|
||||
/**
|
||||
* Previous log timestamp.
|
||||
*/
|
||||
|
||||
var prevTime;
|
||||
|
||||
/**
|
||||
* Select a color.
|
||||
*
|
||||
* @return {Number}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function selectColor() {
|
||||
return exports.colors[prevColor++ % exports.colors.length];
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a debugger with the given `namespace`.
|
||||
*
|
||||
* @param {String} namespace
|
||||
* @return {Function}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function debug(namespace) {
|
||||
|
||||
// define the `disabled` version
|
||||
function disabled() {
|
||||
}
|
||||
disabled.enabled = false;
|
||||
|
||||
// define the `enabled` version
|
||||
function enabled() {
|
||||
|
||||
var self = enabled;
|
||||
|
||||
// set `diff` timestamp
|
||||
var curr = +new Date();
|
||||
var ms = curr - (prevTime || curr);
|
||||
self.diff = ms;
|
||||
self.prev = prevTime;
|
||||
self.curr = curr;
|
||||
prevTime = curr;
|
||||
|
||||
// add the `color` if not set
|
||||
if (null == self.useColors) self.useColors = exports.useColors();
|
||||
if (null == self.color && self.useColors) self.color = selectColor();
|
||||
|
||||
var args = new Array(arguments.length);
|
||||
for (var i = 0; i < args.length; i++) {
|
||||
args[i] = arguments[i];
|
||||
}
|
||||
|
||||
args[0] = exports.coerce(args[0]);
|
||||
|
||||
if ('string' !== typeof args[0]) {
|
||||
// anything else let's inspect with %o
|
||||
args = ['%o'].concat(args);
|
||||
}
|
||||
|
||||
// apply any `formatters` transformations
|
||||
var index = 0;
|
||||
args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {
|
||||
// if we encounter an escaped % then don't increase the array index
|
||||
if (match === '%%') return match;
|
||||
index++;
|
||||
var formatter = exports.formatters[format];
|
||||
if ('function' === typeof formatter) {
|
||||
var val = args[index];
|
||||
match = formatter.call(self, val);
|
||||
|
||||
// now we need to remove `args[index]` since it's inlined in the `format`
|
||||
args.splice(index, 1);
|
||||
index--;
|
||||
}
|
||||
return match;
|
||||
});
|
||||
|
||||
// apply env-specific formatting
|
||||
args = exports.formatArgs.apply(self, args);
|
||||
|
||||
var logFn = enabled.log || exports.log || console.log.bind(console);
|
||||
logFn.apply(self, args);
|
||||
}
|
||||
enabled.enabled = true;
|
||||
|
||||
var fn = exports.enabled(namespace) ? enabled : disabled;
|
||||
|
||||
fn.namespace = namespace;
|
||||
|
||||
return fn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables a debug mode by namespaces. This can include modes
|
||||
* separated by a colon and wildcards.
|
||||
*
|
||||
* @param {String} namespaces
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function enable(namespaces) {
|
||||
exports.save(namespaces);
|
||||
|
||||
var split = (namespaces || '').split(/[\s,]+/);
|
||||
var len = split.length;
|
||||
|
||||
for (var i = 0; i < len; i++) {
|
||||
if (!split[i]) continue; // ignore empty strings
|
||||
namespaces = split[i].replace(/[\\^$+?.()|[\]{}]/g, '\\$&').replace(/\*/g, '.*?');
|
||||
if (namespaces[0] === '-') {
|
||||
exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
|
||||
} else {
|
||||
exports.names.push(new RegExp('^' + namespaces + '$'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable debug output.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function disable() {
|
||||
exports.enable('');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given mode name is enabled, false otherwise.
|
||||
*
|
||||
* @param {String} name
|
||||
* @return {Boolean}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function enabled(name) {
|
||||
var i, len;
|
||||
for (i = 0, len = exports.skips.length; i < len; i++) {
|
||||
if (exports.skips[i].test(name)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (i = 0, len = exports.names.length; i < len; i++) {
|
||||
if (exports.names[i].test(name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Coerce `val`.
|
||||
*
|
||||
* @param {Mixed} val
|
||||
* @return {Mixed}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function coerce(val) {
|
||||
if (val instanceof Error) return val.stack || val.message;
|
||||
return val;
|
||||
}
|
10
node_modules/engine.io-client/node_modules/debug/index.js
generated
vendored
Normal file
10
node_modules/engine.io-client/node_modules/debug/index.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Detect Electron renderer process, which is node, but we should
|
||||
* treat as a browser.
|
||||
*/
|
||||
|
||||
if (typeof process !== 'undefined' && process.type === 'renderer') {
|
||||
module.exports = require('./browser.js');
|
||||
} else {
|
||||
module.exports = require('./node.js');
|
||||
}
|
213
node_modules/engine.io-client/node_modules/debug/node.js
generated
vendored
Normal file
213
node_modules/engine.io-client/node_modules/debug/node.js
generated
vendored
Normal file
@ -0,0 +1,213 @@
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var tty = require('tty');
|
||||
var util = require('util');
|
||||
|
||||
/**
|
||||
* This is the Node.js implementation of `debug()`.
|
||||
*
|
||||
* Expose `debug()` as the module.
|
||||
*/
|
||||
|
||||
exports = module.exports = require('./debug');
|
||||
exports.log = log;
|
||||
exports.formatArgs = formatArgs;
|
||||
exports.save = save;
|
||||
exports.load = load;
|
||||
exports.useColors = useColors;
|
||||
|
||||
/**
|
||||
* Colors.
|
||||
*/
|
||||
|
||||
exports.colors = [6, 2, 3, 4, 5, 1];
|
||||
|
||||
/**
|
||||
* The file descriptor to write the `debug()` calls to.
|
||||
* Set the `DEBUG_FD` env variable to override with another value. i.e.:
|
||||
*
|
||||
* $ DEBUG_FD=3 node script.js 3>debug.log
|
||||
*/
|
||||
|
||||
var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
|
||||
var stream = 1 === fd ? process.stdout :
|
||||
2 === fd ? process.stderr :
|
||||
createWritableStdioStream(fd);
|
||||
|
||||
/**
|
||||
* Is stdout a TTY? Colored output is enabled when `true`.
|
||||
*/
|
||||
|
||||
function useColors() {
|
||||
var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase();
|
||||
if (0 === debugColors.length) {
|
||||
return tty.isatty(fd);
|
||||
} else {
|
||||
return '0' !== debugColors
|
||||
&& 'no' !== debugColors
|
||||
&& 'false' !== debugColors
|
||||
&& 'disabled' !== debugColors;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Map %o to `util.inspect()`, since Node doesn't do that out of the box.
|
||||
*/
|
||||
|
||||
var inspect = (4 === util.inspect.length ?
|
||||
// node <= 0.8.x
|
||||
function (v, colors) {
|
||||
return util.inspect(v, void 0, void 0, colors);
|
||||
} :
|
||||
// node > 0.8.x
|
||||
function (v, colors) {
|
||||
return util.inspect(v, { colors: colors });
|
||||
}
|
||||
);
|
||||
|
||||
exports.formatters.o = exports.formatters.O = function(v) {
|
||||
return inspect(v, this.useColors)
|
||||
.replace(/\s*\n\s*/g, ' ');
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds ANSI color escape codes if enabled.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function formatArgs() {
|
||||
var len = arguments.length;
|
||||
var args = new Array(len);
|
||||
var useColors = this.useColors;
|
||||
var name = this.namespace;
|
||||
for (var i = 0; i < len; i++) {
|
||||
args[i] = arguments[i];
|
||||
}
|
||||
|
||||
if (useColors) {
|
||||
var c = this.color;
|
||||
|
||||
args[0] = ' \u001b[3' + c + ';1m' + name + ' '
|
||||
+ '\u001b[0m'
|
||||
+ args[0];
|
||||
args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
|
||||
} else {
|
||||
args[0] = new Date().toUTCString()
|
||||
+ ' ' + name + ' ' + args[0];
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invokes `console.error()` with the specified arguments.
|
||||
*/
|
||||
|
||||
function log() {
|
||||
return stream.write(util.format.apply(this, arguments) + '\n');
|
||||
}
|
||||
|
||||
/**
|
||||
* Save `namespaces`.
|
||||
*
|
||||
* @param {String} namespaces
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function save(namespaces) {
|
||||
if (null == namespaces) {
|
||||
// If you set a process.env field to null or undefined, it gets cast to the
|
||||
// string 'null' or 'undefined'. Just delete instead.
|
||||
delete process.env.DEBUG;
|
||||
} else {
|
||||
process.env.DEBUG = namespaces;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load `namespaces`.
|
||||
*
|
||||
* @return {String} returns the previously persisted debug modes
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function load() {
|
||||
return process.env.DEBUG;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copied from `node/src/node.js`.
|
||||
*
|
||||
* XXX: It's lame that node doesn't expose this API out-of-the-box. It also
|
||||
* relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
|
||||
*/
|
||||
|
||||
function createWritableStdioStream (fd) {
|
||||
var stream;
|
||||
var tty_wrap = process.binding('tty_wrap');
|
||||
|
||||
// Note stream._type is used for test-module-load-list.js
|
||||
|
||||
switch (tty_wrap.guessHandleType(fd)) {
|
||||
case 'TTY':
|
||||
stream = new tty.WriteStream(fd);
|
||||
stream._type = 'tty';
|
||||
|
||||
// Hack to have stream not keep the event loop alive.
|
||||
// See https://github.com/joyent/node/issues/1726
|
||||
if (stream._handle && stream._handle.unref) {
|
||||
stream._handle.unref();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'FILE':
|
||||
var fs = require('fs');
|
||||
stream = new fs.SyncWriteStream(fd, { autoClose: false });
|
||||
stream._type = 'fs';
|
||||
break;
|
||||
|
||||
case 'PIPE':
|
||||
case 'TCP':
|
||||
var net = require('net');
|
||||
stream = new net.Socket({
|
||||
fd: fd,
|
||||
readable: false,
|
||||
writable: true
|
||||
});
|
||||
|
||||
// FIXME Should probably have an option in net.Socket to create a
|
||||
// stream from an existing fd which is writable only. But for now
|
||||
// we'll just add this hack and set the `readable` member to false.
|
||||
// Test: ./node test/fixtures/echo.js < /etc/passwd
|
||||
stream.readable = false;
|
||||
stream.read = null;
|
||||
stream._type = 'pipe';
|
||||
|
||||
// FIXME Hack to have stream not keep the event loop alive.
|
||||
// See https://github.com/joyent/node/issues/1726
|
||||
if (stream._handle && stream._handle.unref) {
|
||||
stream._handle.unref();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Probably an error on in uv_guess_handle()
|
||||
throw new Error('Implement me. Unknown stream file type!');
|
||||
}
|
||||
|
||||
// For supporting legacy API we put the FD here.
|
||||
stream.fd = fd;
|
||||
|
||||
stream._isStdio = true;
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable namespaces listed in `process.env.DEBUG` initially.
|
||||
*/
|
||||
|
||||
exports.enable(load());
|
113
node_modules/engine.io-client/node_modules/debug/package.json
generated
vendored
Normal file
113
node_modules/engine.io-client/node_modules/debug/package.json
generated
vendored
Normal file
@ -0,0 +1,113 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"debug@2.3.3",
|
||||
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\engine.io-client"
|
||||
]
|
||||
],
|
||||
"_from": "debug@2.3.3",
|
||||
"_id": "debug@2.3.3",
|
||||
"_inCache": true,
|
||||
"_location": "/engine.io-client/debug",
|
||||
"_nodeVersion": "7.0.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/debug-2.3.3.tgz_1479585558307_0.03629564819857478"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "nathan@tootallnate.net",
|
||||
"name": "tootallnate"
|
||||
},
|
||||
"_npmVersion": "3.10.8",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "debug",
|
||||
"raw": "debug@2.3.3",
|
||||
"rawSpec": "2.3.3",
|
||||
"scope": null,
|
||||
"spec": "2.3.3",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/engine.io-client"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz",
|
||||
"_shasum": "40c453e67e6e13c901ddec317af8986cda9eff8c",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "debug@2.3.3",
|
||||
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\engine.io-client",
|
||||
"author": {
|
||||
"email": "tj@vision-media.ca",
|
||||
"name": "TJ Holowaychuk"
|
||||
},
|
||||
"browser": "./browser.js",
|
||||
"bugs": {
|
||||
"url": "https://github.com/visionmedia/debug/issues"
|
||||
},
|
||||
"component": {
|
||||
"scripts": {
|
||||
"debug/debug.js": "debug.js",
|
||||
"debug/index.js": "browser.js"
|
||||
}
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Nathan Rajlich",
|
||||
"email": "nathan@tootallnate.net",
|
||||
"url": "http://n8.io"
|
||||
},
|
||||
{
|
||||
"name": "Andrew Rhyne",
|
||||
"email": "rhyneandrew@gmail.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"ms": "0.7.2"
|
||||
},
|
||||
"description": "small debugging utility",
|
||||
"devDependencies": {
|
||||
"browserify": "9.0.3",
|
||||
"mocha": "*"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "40c453e67e6e13c901ddec317af8986cda9eff8c",
|
||||
"tarball": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz"
|
||||
},
|
||||
"gitHead": "3ad8df75614cd4306709ad73519fd579971fb8d9",
|
||||
"homepage": "https://github.com/visionmedia/debug#readme",
|
||||
"installable": true,
|
||||
"keywords": [
|
||||
"debug",
|
||||
"debugger",
|
||||
"log"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "kolban",
|
||||
"email": "kolban1@kolban.com"
|
||||
},
|
||||
{
|
||||
"name": "thebigredgeek",
|
||||
"email": "rhyneandrew@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "tjholowaychuk",
|
||||
"email": "tj@vision-media.ca"
|
||||
},
|
||||
{
|
||||
"name": "tootallnate",
|
||||
"email": "nathan@tootallnate.net"
|
||||
}
|
||||
],
|
||||
"name": "debug",
|
||||
"optionalDependencies": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/visionmedia/debug.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"version": "2.3.3"
|
||||
}
|
21
node_modules/engine.io-client/node_modules/ms/LICENSE.md
generated
vendored
Normal file
21
node_modules/engine.io-client/node_modules/ms/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 Zeit, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
52
node_modules/engine.io-client/node_modules/ms/README.md
generated
vendored
Normal file
52
node_modules/engine.io-client/node_modules/ms/README.md
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
# ms
|
||||
|
||||
[](https://travis-ci.org/zeit/ms)
|
||||
[](https://github.com/sindresorhus/xo)
|
||||
[](https://zeit.chat/)
|
||||
|
||||
Use this package to easily convert various time formats to milliseconds.
|
||||
|
||||
## Examples
|
||||
|
||||
```js
|
||||
ms('2 days') // 172800000
|
||||
ms('1d') // 86400000
|
||||
ms('10h') // 36000000
|
||||
ms('2.5 hrs') // 9000000
|
||||
ms('2h') // 7200000
|
||||
ms('1m') // 60000
|
||||
ms('5s') // 5000
|
||||
ms('1y') // 31557600000
|
||||
ms('100') // 100
|
||||
```
|
||||
|
||||
### Convert from milliseconds
|
||||
|
||||
```js
|
||||
ms(60000) // "1m"
|
||||
ms(2 * 60000) // "2m"
|
||||
ms(ms('10 hours')) // "10h"
|
||||
```
|
||||
|
||||
### Time format written-out
|
||||
|
||||
```js
|
||||
ms(60000, { long: true }) // "1 minute"
|
||||
ms(2 * 60000, { long: true }) // "2 minutes"
|
||||
ms(ms('10 hours'), { long: true }) // "10 hours"
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
- Works both in [node](https://nodejs.org) and in the browser.
|
||||
- If a number is supplied to `ms`, a string with a unit is returned.
|
||||
- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`).
|
||||
- If you pass a string with a number and a valid unit, the number of equivalent ms is returned.
|
||||
|
||||
## Caught a bug?
|
||||
|
||||
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
|
||||
2. Link the package to the global module directory: `npm link`
|
||||
3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms!
|
||||
|
||||
As always, you can run the tests using: `npm test`
|
149
node_modules/engine.io-client/node_modules/ms/index.js
generated
vendored
Normal file
149
node_modules/engine.io-client/node_modules/ms/index.js
generated
vendored
Normal file
@ -0,0 +1,149 @@
|
||||
/**
|
||||
* Helpers.
|
||||
*/
|
||||
|
||||
var s = 1000
|
||||
var m = s * 60
|
||||
var h = m * 60
|
||||
var d = h * 24
|
||||
var y = d * 365.25
|
||||
|
||||
/**
|
||||
* Parse or format the given `val`.
|
||||
*
|
||||
* Options:
|
||||
*
|
||||
* - `long` verbose formatting [false]
|
||||
*
|
||||
* @param {String|Number} val
|
||||
* @param {Object} options
|
||||
* @throws {Error} throw an error if val is not a non-empty string or a number
|
||||
* @return {String|Number}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function (val, options) {
|
||||
options = options || {}
|
||||
var type = typeof val
|
||||
if (type === 'string' && val.length > 0) {
|
||||
return parse(val)
|
||||
} else if (type === 'number' && isNaN(val) === false) {
|
||||
return options.long ?
|
||||
fmtLong(val) :
|
||||
fmtShort(val)
|
||||
}
|
||||
throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val))
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the given `str` and return milliseconds.
|
||||
*
|
||||
* @param {String} str
|
||||
* @return {Number}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function parse(str) {
|
||||
str = String(str)
|
||||
if (str.length > 10000) {
|
||||
return
|
||||
}
|
||||
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str)
|
||||
if (!match) {
|
||||
return
|
||||
}
|
||||
var n = parseFloat(match[1])
|
||||
var type = (match[2] || 'ms').toLowerCase()
|
||||
switch (type) {
|
||||
case 'years':
|
||||
case 'year':
|
||||
case 'yrs':
|
||||
case 'yr':
|
||||
case 'y':
|
||||
return n * y
|
||||
case 'days':
|
||||
case 'day':
|
||||
case 'd':
|
||||
return n * d
|
||||
case 'hours':
|
||||
case 'hour':
|
||||
case 'hrs':
|
||||
case 'hr':
|
||||
case 'h':
|
||||
return n * h
|
||||
case 'minutes':
|
||||
case 'minute':
|
||||
case 'mins':
|
||||
case 'min':
|
||||
case 'm':
|
||||
return n * m
|
||||
case 'seconds':
|
||||
case 'second':
|
||||
case 'secs':
|
||||
case 'sec':
|
||||
case 's':
|
||||
return n * s
|
||||
case 'milliseconds':
|
||||
case 'millisecond':
|
||||
case 'msecs':
|
||||
case 'msec':
|
||||
case 'ms':
|
||||
return n
|
||||
default:
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Short format for `ms`.
|
||||
*
|
||||
* @param {Number} ms
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function fmtShort(ms) {
|
||||
if (ms >= d) {
|
||||
return Math.round(ms / d) + 'd'
|
||||
}
|
||||
if (ms >= h) {
|
||||
return Math.round(ms / h) + 'h'
|
||||
}
|
||||
if (ms >= m) {
|
||||
return Math.round(ms / m) + 'm'
|
||||
}
|
||||
if (ms >= s) {
|
||||
return Math.round(ms / s) + 's'
|
||||
}
|
||||
return ms + 'ms'
|
||||
}
|
||||
|
||||
/**
|
||||
* Long format for `ms`.
|
||||
*
|
||||
* @param {Number} ms
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function fmtLong(ms) {
|
||||
return plural(ms, d, 'day') ||
|
||||
plural(ms, h, 'hour') ||
|
||||
plural(ms, m, 'minute') ||
|
||||
plural(ms, s, 'second') ||
|
||||
ms + ' ms'
|
||||
}
|
||||
|
||||
/**
|
||||
* Pluralization helper.
|
||||
*/
|
||||
|
||||
function plural(ms, n, name) {
|
||||
if (ms < n) {
|
||||
return
|
||||
}
|
||||
if (ms < n * 1.5) {
|
||||
return Math.floor(ms / n) + ' ' + name
|
||||
}
|
||||
return Math.ceil(ms / n) + ' ' + name + 's'
|
||||
}
|
99
node_modules/engine.io-client/node_modules/ms/package.json
generated
vendored
Normal file
99
node_modules/engine.io-client/node_modules/ms/package.json
generated
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"ms@0.7.2",
|
||||
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\engine.io-client\\node_modules\\debug"
|
||||
]
|
||||
],
|
||||
"_from": "ms@0.7.2",
|
||||
"_id": "ms@0.7.2",
|
||||
"_inCache": true,
|
||||
"_location": "/engine.io-client/ms",
|
||||
"_nodeVersion": "6.8.0",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-18-east.internal.npmjs.com",
|
||||
"tmp": "tmp/ms-0.7.2.tgz_1477383407940_0.4743474116548896"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "leo@zeit.co",
|
||||
"name": "leo"
|
||||
},
|
||||
"_npmVersion": "3.10.8",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "ms",
|
||||
"raw": "ms@0.7.2",
|
||||
"rawSpec": "0.7.2",
|
||||
"scope": null,
|
||||
"spec": "0.7.2",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/engine.io-client/debug"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz",
|
||||
"_shasum": "ae25cf2512b3885a1d95d7f037868d8431124765",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "ms@0.7.2",
|
||||
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\engine.io-client\\node_modules\\debug",
|
||||
"bugs": {
|
||||
"url": "https://github.com/zeit/ms/issues"
|
||||
},
|
||||
"component": {
|
||||
"scripts": {
|
||||
"ms/index.js": "index.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Tiny milisecond conversion utility",
|
||||
"devDependencies": {
|
||||
"expect.js": "^0.3.1",
|
||||
"mocha": "^3.0.2",
|
||||
"serve": "^1.4.0",
|
||||
"xo": "^0.17.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "ae25cf2512b3885a1d95d7f037868d8431124765",
|
||||
"tarball": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "ac92a7e0790ba2622a74d9d60690ca0d2c070a45",
|
||||
"homepage": "https://github.com/zeit/ms#readme",
|
||||
"installable": true,
|
||||
"license": "MIT",
|
||||
"main": "./index",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "leo",
|
||||
"email": "leo@zeit.co"
|
||||
},
|
||||
{
|
||||
"name": "rauchg",
|
||||
"email": "rauchg@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "ms",
|
||||
"optionalDependencies": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/zeit/ms.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && mocha test/index.js",
|
||||
"test-browser": "serve ./test"
|
||||
},
|
||||
"version": "0.7.2",
|
||||
"xo": {
|
||||
"envs": [
|
||||
"mocha"
|
||||
],
|
||||
"rules": {
|
||||
"complexity": 0
|
||||
},
|
||||
"semicolon": false,
|
||||
"space": true
|
||||
}
|
||||
}
|
141
node_modules/engine.io-client/package.json
generated
vendored
Normal file
141
node_modules/engine.io-client/package.json
generated
vendored
Normal file
@ -0,0 +1,141 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"engine.io-client@1.8.0",
|
||||
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\socket.io-client"
|
||||
]
|
||||
],
|
||||
"_from": "engine.io-client@1.8.0",
|
||||
"_id": "engine.io-client@1.8.0",
|
||||
"_inCache": true,
|
||||
"_location": "/engine.io-client",
|
||||
"_nodeVersion": "4.4.7",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/engine.io-client-1.8.0.tgz_1479608866356_0.14154032664373517"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "damien.arrachequesne@gmail.com",
|
||||
"name": "darrachequesne"
|
||||
},
|
||||
"_npmVersion": "2.15.8",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "engine.io-client",
|
||||
"raw": "engine.io-client@1.8.0",
|
||||
"rawSpec": "1.8.0",
|
||||
"scope": null,
|
||||
"spec": "1.8.0",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/socket.io-client"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-1.8.0.tgz",
|
||||
"_shasum": "7b730e4127414087596d9be3c88d2bc5fdb6cf5c",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "engine.io-client@1.8.0",
|
||||
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\socket.io-client",
|
||||
"browser": {
|
||||
"ws": false,
|
||||
"xmlhttprequest-ssl": "./lib/xmlhttprequest.js"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/socketio/engine.io-client/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Guillermo Rauch",
|
||||
"email": "rauchg@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Vladimir Dronnikov",
|
||||
"email": "dronnikov@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Christoph Dorn",
|
||||
"url": "https://github.com/cadorn"
|
||||
},
|
||||
{
|
||||
"name": "Mark Mokryn",
|
||||
"email": "mokesmokes@gmail.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"component-emitter": "1.2.1",
|
||||
"component-inherit": "0.0.3",
|
||||
"debug": "2.3.3",
|
||||
"engine.io-parser": "1.3.1",
|
||||
"has-cors": "1.1.0",
|
||||
"indexof": "0.0.1",
|
||||
"parsejson": "0.0.3",
|
||||
"parseqs": "0.0.5",
|
||||
"parseuri": "0.0.5",
|
||||
"ws": "1.1.1",
|
||||
"xmlhttprequest-ssl": "1.5.3",
|
||||
"yeast": "0.1.2"
|
||||
},
|
||||
"description": "Client for the realtime Engine",
|
||||
"devDependencies": {
|
||||
"babel-core": "6.4.5",
|
||||
"babel-eslint": "4.1.7",
|
||||
"babel-loader": "6.2.1",
|
||||
"babel-preset-es2015": "6.3.13",
|
||||
"blob": "0.0.4",
|
||||
"concat-stream": "1.4.6",
|
||||
"del": "2.2.0",
|
||||
"derequire": "1.2.0",
|
||||
"engine.io": "1.8.0",
|
||||
"eslint-config-standard": "4.4.0",
|
||||
"eslint-plugin-standard": "1.3.1",
|
||||
"expect.js": "0.2.0",
|
||||
"express": "3.4.8",
|
||||
"gulp": "3.9.0",
|
||||
"gulp-eslint": "1.1.1",
|
||||
"gulp-file": "0.2.0",
|
||||
"gulp-istanbul": "0.10.3",
|
||||
"gulp-mocha": "2.2.0",
|
||||
"gulp-task-listing": "1.0.1",
|
||||
"istanbul": "0.2.3",
|
||||
"mocha": "1.16.2",
|
||||
"webpack": "1.12.12",
|
||||
"webpack-stream": "3.1.0",
|
||||
"zuul": "3.11.0",
|
||||
"zuul-builder-webpack": "1.1.0",
|
||||
"zuul-ngrok": "4.0.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "7b730e4127414087596d9be3c88d2bc5fdb6cf5c",
|
||||
"tarball": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-1.8.0.tgz"
|
||||
},
|
||||
"files": [
|
||||
"engine.io.js",
|
||||
"index.js",
|
||||
"lib/"
|
||||
],
|
||||
"gitHead": "6d7d66401b0a7968d89c2998fbc98586184d6cc3",
|
||||
"homepage": "https://github.com/socketio/engine.io-client",
|
||||
"installable": true,
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "darrachequesne",
|
||||
"email": "damien.arrachequesne@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "rauchg",
|
||||
"email": "rauchg@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "engine.io-client",
|
||||
"optionalDependencies": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/socketio/engine.io-client.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "gulp test"
|
||||
},
|
||||
"version": "1.8.0"
|
||||
}
|
Reference in New Issue
Block a user