Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added support for socket.io .8.5

  • Loading branch information...
commit 755fc0b5172523d386dadf62e3af3083a2a62ca3 1 parent fa9e099
Jeremy Jones authored
Showing with 22,171 additions and 727 deletions.
  1. +5 −15 node/easyWebSocket-node.js
  2. +4 −0 node/server/node_modules/socket.io-client/.gitignore
  3. +2 −0  node/server/node_modules/socket.io-client/.npmignore
  4. +95 −0 node/server/node_modules/socket.io-client/History.md
  5. +20 −0 node/server/node_modules/socket.io-client/Makefile
  6. +246 −0 node/server/node_modules/socket.io-client/README.md
  7. +285 −0 node/server/node_modules/socket.io-client/bin/builder.js
  8. BIN  node/server/node_modules/socket.io-client/dist/WebSocketMain.swf
  9. BIN  node/server/node_modules/socket.io-client/dist/WebSocketMainInsecure.swf
  10. +3,707 −0 node/server/node_modules/socket.io-client/dist/socket.io.js
  11. +2 −0  node/server/node_modules/socket.io-client/dist/socket.io.min.js
  12. +184 −0 node/server/node_modules/socket.io-client/lib/events.js
  13. +205 −0 node/server/node_modules/socket.io-client/lib/io.js
  14. +322 −0 node/server/node_modules/socket.io-client/lib/json.js
  15. +242 −0 node/server/node_modules/socket.io-client/lib/namespace.js
  16. +262 −0 node/server/node_modules/socket.io-client/lib/parser.js
  17. +1 −0  node/server/node_modules/socket.io-client/lib/socket.io-client.js
  18. +524 −0 node/server/node_modules/socket.io-client/lib/socket.js
  19. +234 −0 node/server/node_modules/socket.io-client/lib/transport.js
  20. +191 −0 node/server/node_modules/socket.io-client/lib/transports/flashsocket.js
  21. +172 −0 node/server/node_modules/socket.io-client/lib/transports/htmlfile.js
  22. +217 −0 node/server/node_modules/socket.io-client/lib/transports/jsonp-polling.js
  23. +183 −0 node/server/node_modules/socket.io-client/lib/transports/websocket.js
  24. +155 −0 node/server/node_modules/socket.io-client/lib/transports/xhr-polling.js
  25. +213 −0 node/server/node_modules/socket.io-client/lib/transports/xhr.js
  26. +366 −0 node/server/node_modules/socket.io-client/lib/util.js
  27. 0  node/server/node_modules/{socket.io/support → }/socket.io-client/lib/vendor/web-socket-js/.gitignore
  28. +157 −0 node/server/node_modules/socket.io-client/lib/vendor/web-socket-js/README.md
  29. BIN  node/server/node_modules/socket.io-client/lib/vendor/web-socket-js/WebSocketMain.swf
  30. BIN  node/server/node_modules/socket.io-client/lib/vendor/web-socket-js/WebSocketMainInsecure.zip
  31. +8 −0 node/server/node_modules/socket.io-client/lib/vendor/web-socket-js/flash-src/IWebSocketLogger.as
  32. +464 −0 node/server/node_modules/socket.io-client/lib/vendor/web-socket-js/flash-src/WebSocket.as
  33. +33 −0 node/server/node_modules/socket.io-client/lib/vendor/web-socket-js/flash-src/WebSocketEvent.as
  34. +150 −0 node/server/node_modules/socket.io-client/lib/vendor/web-socket-js/flash-src/WebSocketMain.as
  35. 0  ...es/{socket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/WebSocketMainInsecure.as
  36. +10 −0 node/server/node_modules/socket.io-client/lib/vendor/web-socket-js/flash-src/build.sh
  37. 0  ...support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/adobe/net/proxies/RFC2817Socket.as
  38. 0  ...{socket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/gsolo/encryption/MD5.as
  39. 0  ...socket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/Crypto.as
  40. 0  ...r; }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/cert/MozillaRootCertificates.as
  41. 0  ...ort → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/cert/X509Certificate.as
  42. 0  ... }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/cert/X509CertificateCollection.as
  43. 0  ...ket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/HMAC.as
  44. 0  ...et.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/IHMAC.as
  45. 0  ...et.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/IHash.as
  46. 0  ...cket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/MAC.as
  47. 0  ...cket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/MD2.as
  48. 0  ...cket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/MD5.as
  49. 0  ...ket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHA1.as
  50. 0  ...t.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHA224.as
  51. 0  ...t.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHA256.as
  52. 0  ....io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHABase.as
  53. 0  ...ket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/ARC4.as
  54. 0  ...et.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/IPRNG.as
  55. 0  ...t.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/Random.as
  56. 0  ...t.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/TLSPRF.as
  57. 0  ...et.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/rsa/RSAKey.as
  58. 0  ...support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/AESKey.as
  59. 0  ...rt → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/BlowFishKey.as
  60. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CBCMode.as
  61. 0  ...pport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CFB8Mode.as
  62. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CFBMode.as
  63. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CTRMode.as
  64. 0  ...support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/DESKey.as
  65. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/ECBMode.as
  66. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/ICipher.as
  67. 0  .../support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IMode.as
  68. 0  ...o/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IPad.as
  69. 0  ... → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IStreamCipher.as
  70. 0  ... → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/ISymmetricKey.as
  71. 0  ...support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IVMode.as
  72. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/NullPad.as
  73. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/OFBMode.as
  74. 0  .../support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/PKCS5.as
  75. 0  ...support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/SSLPad.as
  76. 0  ...t → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/SimpleIVMode.as
  77. 0  ...support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/TLSPad.as
  78. 0  ...t → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/TripleDESKey.as
  79. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/XTeaKey.as
  80. 0  ...support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/aeskey.pl
  81. 0  .../support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/dump.txt
  82. 0  ...support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/AESKeyTest.as
  83. 0  ...o/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/ARC4Test.as
  84. 0  ...ort → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/BigIntegerTest.as
  85. 0  ...rt → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/BlowFishKeyTest.as
  86. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CBCModeTest.as
  87. 0  ...pport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CFB8ModeTest.as
  88. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CFBModeTest.as
  89. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CTRModeTest.as
  90. 0  ...support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/DESKeyTest.as
  91. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/ECBModeTest.as
  92. 0  ...o/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/HMACTest.as
  93. 0  ...pport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/ITestHarness.as
  94. 0  ...io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/MD2Test.as
  95. 0  ...io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/MD5Test.as
  96. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/OFBModeTest.as
  97. 0  ...support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/RSAKeyTest.as
  98. 0  ...o/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/SHA1Test.as
  99. 0  ...support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/SHA224Test.as
  100. 0  ...support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/SHA256Test.as
  101. 0  ...support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TLSPRFTest.as
  102. 0  ...o/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TestCase.as
  103. 0  ...t → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TripleDESKeyTest.as
  104. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/XTeaKeyTest.as
  105. 0  .../support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/BulkCiphers.as
  106. 0  ...support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/CipherSuites.as
  107. 0  ...ort → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/IConnectionState.as
  108. 0  ... → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/ISecurityParameters.as
  109. 0  ...support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/KeyExchanges.as
  110. 0  ...cket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/MACs.as
  111. 0  ...t → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/SSLConnectionState.as
  112. 0  ....io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/SSLEvent.as
  113. 0  ...rarr; }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/SSLSecurityParameters.as
  114. 0  ...io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSConfig.as
  115. 0  ...t → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSConnectionState.as
  116. 0  ...io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSEngine.as
  117. 0  ....io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSError.as
  118. 0  ....io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSEvent.as
  119. 0  ...rarr; }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSSecurityParameters.as
  120. 0  ...io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSSocket.as
  121. 0  ...pport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSSocketEvent.as
  122. 0  ...t.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSTest.as
  123. 0  ...o/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/BarrettReduction.as
  124. 0  ...cket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/BigInteger.as
  125. 0  ...o/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/ClassicReduction.as
  126. 0  ...cket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/IReduction.as
  127. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/MontgomeryReduction.as
  128. 0  ...t.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/NullReduction.as
  129. 0  ...ket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/bi_internal.as
  130. 0  ...ocket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/ArrayUtil.as
  131. 0  .../{socket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/Base64.as
  132. 0  ...les/{socket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/Hex.as
  133. 0  .../{socket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/Memory.as
  134. 0  ....io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/ByteString.as
  135. 0  ...{socket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/DER.as
  136. 0  ...t.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/IAsn1Type.as
  137. 0  ...ket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/Integer.as
  138. 0  ...{socket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/OID.as
  139. 0  ...pport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/ObjectIdentifier.as
  140. 0  ...{socket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/PEM.as
  141. 0  ...upport → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/PrintableString.as
  142. 0  ...et.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/Sequence.as
  143. 0  ...{socket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/Set.as
  144. 0  ...socket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/Type.as
  145. 0  ...ket.io/support → }/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/UTCTime.as
  146. +75 −0 node/server/node_modules/socket.io-client/lib/vendor/web-socket-js/sample.html
  147. 0  node/server/node_modules/{socket.io/support → }/socket.io-client/lib/vendor/web-socket-js/swfobject.js
  148. +349 −0 node/server/node_modules/socket.io-client/lib/vendor/web-socket-js/web_socket.js
  149. +1 −0  node/server/node_modules/socket.io-client/node_modules/.bin/uglifyjs
  150. +4 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/.gitignore
  151. +835 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/README.html
  152. +437 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/README.org
  153. +309 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/bin/uglifyjs
  154. +75 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/docstyle.css
  155. +1,340 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/lib/parse-js.js
  156. +1,774 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/lib/process.js
  157. +22 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/lib/squeeze-more.js
  158. +22 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/package.json
  159. +28 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/beautify.js
  160. +402 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/testparser.js
  161. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/array1.js
  162. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/array2.js
  163. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/array3.js
  164. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/array4.js
  165. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/assignment.js
  166. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/concatstring.js
  167. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/const.js
  168. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/empty-blocks.js
  169. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/forstatement.js
  170. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/if.js
  171. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/ifreturn.js
  172. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/ifreturn2.js
  173. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue10.js
  174. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue11.js
  175. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue13.js
  176. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue14.js
  177. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue16.js
  178. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue17.js
  179. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue20.js
  180. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue21.js
  181. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue25.js
  182. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue27.js
  183. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue28.js
  184. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue29.js
  185. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue30.js
  186. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue34.js
  187. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue4.js
  188. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue48.js
  189. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue50.js
  190. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue53.js
  191. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue54.1.js
  192. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue68.js
  193. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue69.js
  194. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/issue9.js
  195. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/mangle.js
  196. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/strict-equals.js
  197. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/var.js
  198. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/expected/with.js
  199. +3 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/array1.js
  200. +4 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/array2.js
  201. +4 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/array3.js
  202. +6 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/array4.js
  203. +20 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/assignment.js
  204. +3 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/concatstring.js
  205. +5 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/const.js
  206. +4 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/empty-blocks.js
  207. +10 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/forstatement.js
  208. +6 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/if.js
  209. +9 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/ifreturn.js
  210. +16 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/ifreturn2.js
  211. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue10.js
  212. +3 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue11.js
  213. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue13.js
  214. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue14.js
  215. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue16.js
  216. +4 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue17.js
  217. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue20.js
  218. +6 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue21.js
  219. +7 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue25.js
  220. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue27.js
  221. +3 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue28.js
  222. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue29.js
  223. +3 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue30.js
  224. +3 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue34.js
  225. +3 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue4.js
  226. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue48.js
  227. +9 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue50.js
  228. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue53.js
  229. +3 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue54.1.js
  230. +5 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue68.js
  231. +1 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue69.js
  232. +4 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/issue9.js
  233. +5 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/mangle.js
  234. +3 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/strict-equals.js
  235. +3 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/var.js
  236. +2 −0  node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/compress/test/with.js
  237. +55 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/test/unit/scripts.js
  238. +97 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/tmp/instrument.js
  239. +138 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/tmp/instrument2.js
  240. +17 −0 node/server/node_modules/socket.io-client/node_modules/uglify-js/uglify-js.js
  241. +27 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/LICENSE
  242. +22 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/Makefile
  243. +41 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/README.md
  244. +12 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/examples/client-unix.js
  245. +10 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/examples/client.js
  246. +13 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/examples/server-unix.js
  247. +599 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/lib/websocket.js
  248. +585 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/new
  249. +562 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/old
  250. +22 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/package.json
  251. +68 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/test/test-basic.js
  252. +43 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/test/test-client-close.js
  253. +43 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/test/test-readonly-attrs.js
  254. +26 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/test/test-ready-state.js
  255. +41 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/test/test-server-close.js
  256. +63 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/test/test-unix-send-fd.js
  257. +46 −0 node/server/node_modules/socket.io-client/node_modules/websocket-client/test/test-unix-sockets.js
  258. +19 −0 node/server/node_modules/socket.io-client/node_modules/xmlhttprequest/README.md
  259. +309 −0 node/server/node_modules/socket.io-client/node_modules/xmlhttprequest/XMLHttpRequest.js
  260. +8 −0 node/server/node_modules/socket.io-client/node_modules/xmlhttprequest/autotest.watchr
  261. +16 −0 node/server/node_modules/socket.io-client/node_modules/xmlhttprequest/demo.js
  262. +16 −0 node/server/node_modules/socket.io-client/node_modules/xmlhttprequest/package.json
  263. +13 −0 node/server/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-constants.js
  264. +35 −0 node/server/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-headers.js
  265. +62 −0 node/server/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-request.js
  266. +34 −0 node/server/node_modules/socket.io-client/package.json
  267. +1,238 −0 node/server/node_modules/socket.io-client/support/should.js
  268. +309 −0 node/server/node_modules/socket.io-client/support/test-runner/app.js
  269. +28 −0 node/server/node_modules/socket.io-client/support/test-runner/index.jade
  270. +18 −0 node/server/node_modules/socket.io-client/support/test-runner/public/javascript/jquery.js
  271. +211 −0 node/server/node_modules/socket.io-client/support/test-runner/public/javascript/runner.js
  272. +107 −0 node/server/node_modules/socket.io-client/support/test-runner/public/javascript/script.js
  273. +116 −0 node/server/node_modules/socket.io-client/support/test-runner/public/stylesheets/main.css
  274. +101 −0 node/server/node_modules/socket.io-client/support/test-runner/public/stylesheets/main.styl
  275. +121 −0 node/server/node_modules/socket.io-client/test/events.test.js
  276. +31 −0 node/server/node_modules/socket.io-client/test/io.test.js
  277. +102 −0 node/server/node_modules/socket.io-client/test/node/builder.common.js
  278. +131 −0 node/server/node_modules/socket.io-client/test/node/builder.test.js
  279. +360 −0 node/server/node_modules/socket.io-client/test/parser.test.js
  280. +366 −0 node/server/node_modules/socket.io-client/test/socket.test.js
  281. +156 −0 node/server/node_modules/socket.io-client/test/util.test.js
  282. +2 −1  node/server/node_modules/socket.io/.gitignore
  283. +3 −0  node/server/node_modules/socket.io/.npmignore
  284. +142 −206 node/server/node_modules/socket.io/History.md
  285. +16 −7 node/server/node_modules/socket.io/Makefile
  286. +0 −229 node/server/node_modules/socket.io/README.md
  287. +343 −0 node/server/node_modules/socket.io/Readme.md
  288. +0 −61 node/server/node_modules/socket.io/example/chat-ssl.html
  289. +0 −61 node/server/node_modules/socket.io/example/chat.html
  290. +0 −18 node/server/node_modules/socket.io/example/json.js
  291. +0 −66 node/server/node_modules/socket.io/example/server-ssl.js
  292. +0 −63 node/server/node_modules/socket.io/example/server.js
  293. +87 −0 node/server/node_modules/socket.io/examples/chat/app.js
  294. +83 −0 node/server/node_modules/socket.io/examples/chat/index.jade
  295. +11 −0 node/server/node_modules/socket.io/examples/chat/package.json
  296. +96 −0 node/server/node_modules/socket.io/examples/chat/public/stylesheets/mixins.styl
  297. +188 −0 node/server/node_modules/socket.io/examples/chat/public/stylesheets/style.css
  298. +118 −0 node/server/node_modules/socket.io/examples/chat/public/stylesheets/style.styl
  299. +81 −0 node/server/node_modules/socket.io/examples/irc-output/app.js
  300. +28 −0 node/server/node_modules/socket.io/examples/irc-output/index.jade
Sorry, we could not display the entire diff because too many files (1,015) changed.
View
20 node/easyWebSocket-node.js
@@ -48,21 +48,12 @@ EasyWebSocket.prototype._sioCtor = function()
var listenHost = serverUrl.host;
var listenPort = parseInt(serverUrl.port);
- // configure the swf for the flash websocket
- // - NOTE: not sure about this. i dont understand flash 'security'
- WEB_SOCKET_SWF_LOCATION = 'http://easywebsocket.org/node/server/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/WebSocketMainInsecure.swf';
-
// create and config the socket
- this._sockio = new io.Socket(listenHost, {
- port : listenPort
- //rememberTransport : false,
- //transports : ['websocket', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling']
- });
- this._sockio.connect();
+ this._sockio = io.connect(listenHost + ":" + listenPort, { 'force new connection': true });
this._sockio.on('connect', function(){
self.log("socket connected", self._sockio, self._clientId)
// send the connect message
- self._sockio.send({
+ self._sockio.json.send({
type : "connect",
data : {
wsUrl : self.url,
@@ -80,11 +71,11 @@ EasyWebSocket.prototype._sioCtor = function()
this._sockio.on('message', function(message){
self.log("received message", message);
// notify the received message
- self.onmessage({data: message})
+ self.onmessage({data: message})
})
this._sockio.on('disconnect', function(){
self.log("socket disconnected")
- self.onclose() // TODO is there an event attached to that
+ self.onclose(); // TODO is there an event attached to that
})
}
@@ -99,7 +90,7 @@ EasyWebSocket.prototype._sioCtor = function()
*/
EasyWebSocket.prototype.send = function(data)
{
- this._sockio.send({
+ this._sockio.json.send({
type : "message",
data : {
clientId: this._clientId,
@@ -134,7 +125,6 @@ EasyWebSocket.CLOSED = 3;
* * EasyWebSocket.iframeOrigin = "http://localhost:8080";
* * EasyWebSocket.logFunction = console.log.bind(console);
*/
-EasyWebSocket.serverUrl = "http://88.191.76.230:8950"; // TODO change this to be tunable and work on nodester
EasyWebSocket.logFunction = function(){}
//////////////////////////////////////////////////////////////////////////////////
View
4 node/server/node_modules/socket.io-client/.gitignore
@@ -0,0 +1,4 @@
+s3
+test/node_modules
+support/test-runner/node_modules
+node_modules
View
2  node/server/node_modules/socket.io-client/.npmignore
@@ -0,0 +1,2 @@
+test/node_modules
+support
View
95 node/server/node_modules/socket.io-client/History.md
@@ -0,0 +1,95 @@
+
+0.8.3 / 2011-09-03
+==================
+
+ * Fixed `\n` parsing for non-JSON packets.
+ * Fixed; make Socket.IO XHTML doctype compatible (fixes #460 from server)
+ * Fixed support for Node.JS running `socket.io-client`.
+ * Updated repository name in `package.json`.
+ * Added support for different policy file ports without having to port
+ forward 843 on the server side [3rd-Eden]
+
+0.8.2 / 2011-08-29
+==================
+
+ * Fixed flashsocket detection.
+
+0.8.1 / 2011-08-29
+==================
+
+ * Bump version.
+
+0.8.0 / 2011-08-28
+==================
+
+ * Added MozWebSocket support (hybi-10 doesn't require API changes) [einaros].
+
+0.7.11 / 2011-08-27
+===================
+
+ * Corrected previous release (missing build).
+
+0.7.10 / 2011-08-27
+===================
+
+ * Fix for failing fallback in websockets
+
+0.7.9 / 2011-08-12
+==================
+
+ * Added check on `Socket#onConnect` to prevent double `connect` events on the main manager.
+ * Fixed socket namespace connect test. Remove broken alternative namespace connect test.
+ * Removed test handler for removed test.
+ * Bumped version to match `socket.io` server.
+
+0.7.5 / 2011-08-08
+==================
+
+ * Added querystring support for `connect` [3rd-Eden]
+ * Added partial Node.JS transports support [3rd-Eden, josephg]
+ * Fixed builder test.
+ * Changed `util.inherit` to replicate Object.create / __proto__.
+ * Changed and cleaned up some acceptance tests.
+ * Fixed race condition with a test that could not be run multiple times.
+ * Added test for encoding a payload.
+ * Added the ability to override the transport to use in acceptance test [3rd-Eden]
+ * Fixed multiple connect packets [DanielBaulig]
+ * Fixed jsonp-polling over-buffering [3rd-Eden]
+ * Fixed ascii preservation in minified socket.io client [3rd-Eden]
+ * Fixed socket.io in situations where the page is not served through utf8.
+ * Fixed namespaces not reconnecting after disconnect [3rd-Eden]
+ * Fixed default port for secure connections.
+
+0.7.4 / 2011-07-12
+==================
+
+ * Added `SocketNamespace#of` shortcut. [3rd-Eden]
+ * Fixed a IE payload decoding bug. [3rd-Eden]
+ * Honor document protocol, unless overriden. [dvv]
+ * Fixed new builder dependencies. [3rd-Eden]
+
+0.7.3 / 2011-06-30
+==================
+
+ * Fixed; acks don't depend on arity. They're automatic for `.send` and
+ callback based for `.emit`. [dvv]
+ * Added support for sub-sockets authorization. [3rd-Eden]
+ * Added BC support for `new io.connect`. [fat]
+ * Fixed double `connect` events. [3rd-Eden]
+ * Fixed reconnection with jsonp-polling maintaining old sessionid. [franck34]
+
+0.7.2 / 2011-06-22
+==================
+
+ * Added `noop` message type.
+
+0.7.1 / 2011-06-21
+==================
+
+ * Bumped socket.io dependency version for acceptance tests.
+
+0.7.0 / 2011-06-21
+==================
+
+ * http://socket.io/announcement.html
+
View
20 node/server/node_modules/socket.io-client/Makefile
@@ -0,0 +1,20 @@
+
+ALL_TESTS = $(shell find test/ -name '*.test.js')
+
+run-tests:
+ @./node_modules/.bin/expresso \
+ -I lib \
+ -I support \
+ --serial \
+ $(TESTS)
+
+test:
+ @$(MAKE) TESTS="$(ALL_TESTS)" run-tests
+
+test-acceptance:
+ @node support/test-runner/app $(TRANSPORT)
+
+build:
+ @node ./bin/builder.js
+
+.PHONY: test
View
246 node/server/node_modules/socket.io-client/README.md
@@ -0,0 +1,246 @@
+socket.io
+=========
+
+#### Sockets for the rest of us
+
+The `socket.io` client is basically a simple HTTP Socket interface implementation.
+It looks similar to WebSocket while providing additional features and
+leveraging other transports when WebSocket is not supported by the user's
+browser.
+
+```js
+var socket = io.connect('http://domain.com');
+socket.on('connect', function () {
+ // socket connected
+});
+socket.on('custom event', function () {
+ // server emitted a custom event
+});
+socket.on('disconnect', function () {
+ // socket disconnected
+});
+socket.send('hi there');
+```
+
+### Recipes
+
+#### Utilizing namespaces (ie: multiple sockets)
+
+If you want to namespace all the messages and events emitted to a particular
+endpoint, simply specify it as part of the `connect` uri:
+
+```js
+var chat = io.connect('http://localhost/chat');
+chat.on('connect', function () {
+ // chat socket connected
+});
+
+var news = io.connect('/news'); // io.connect auto-detects host
+news.on('connect', function () {
+ // news socket connected
+});
+```
+
+#### Emitting custom events
+
+To ease with the creation of applications, you can emit custom events outside
+of the global `message` event.
+
+```js
+var socket = io.connect();
+socket.emit('server custom event', { my: 'data' });
+```
+
+#### Forcing disconnection
+
+```js
+var socket = io.connect();
+socket.on('connect', function () {
+ socket.disconnect();
+});
+```
+
+### Documentation
+
+#### io#connect
+
+```js
+io.connect(uri, [options]);
+```
+
+##### Options:
+
+- *resource*
+
+ socket.io
+
+ The resource is what allows the `socket.io` server to identify incoming connections by `socket.io` clients. In other words, any HTTP server can implement socket.io and still serve other normal, non-realtime HTTP requests.
+
+- *transports*
+
+```js
+['websocket', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling', 'jsonp-polling']
+```
+
+ A list of the transports to attempt to utilize (in order of preference).
+
+- *'connect timeout'*
+
+```js
+5000
+```
+
+ The amount of milliseconds a transport has to create a connection before we consider it timed out.
+
+- *'try multiple transports'*
+
+```js
+true
+```
+
+ A boolean indicating if we should try other transports when the connectTimeout occurs.
+
+- *reconnect*
+
+```js
+true
+```
+
+ A boolean indicating if we should automatically reconnect if a connection is disconnected.
+
+- *'reconnection delay'*
+
+```js
+500
+```
+
+ The amount of milliseconds before we try to connect to the server again. We are using a exponential back off algorithm for the following reconnections, on each reconnect attempt this value will get multiplied (500 > 1000 > 2000 > 4000 > 8000).
+
+
+- *'max reconnection attempts'*
+
+```js
+10
+```
+
+ The amount of attempts should we make using the current transport to connect to the server? After this we will do one final attempt, and re-try with all enabled transport methods before we give up.
+
+##### Properties:
+
+- *options*
+
+ The passed in options combined with the defaults.
+
+- *connected*
+
+ Whether the socket is connected or not.
+
+- *connecting*
+
+ Whether the socket is connecting or not.
+
+- *reconnecting*
+
+ Whether we are reconnecting or not.
+
+- *transport*
+
+ The transport instance.
+
+##### Methods:
+
+- *connect(λ)*
+
+ Establishes a connection. If λ is supplied as argument, it will be called once the connection is established.
+
+- *send(message)*
+
+ A string of data to send.
+
+- *disconnect*
+
+ Closes the connection.
+
+- *on(event, λ)*
+
+ Adds a listener for the event *event*.
+
+- *once(event, λ)*
+
+ Adds a one time listener for the event *event*. The listener is removed after the first time the event is fired.
+
+- *removeEvent(event, λ)*
+
+ Removes the listener λ for the event *event*.
+
+##### Events:
+
+- *connect*
+
+ Fired when the connection is established and the handshake successful.
+
+- *connecting(transport_type)*
+
+ Fired when a connection is attempted, passing the transport name.
+
+- *connect_failed*
+
+ Fired when the connection timeout occurs after the last connection attempt.
+ This only fires if the `connectTimeout` option is set.
+ If the `tryTransportsOnConnectTimeout` option is set, this only fires once all
+ possible transports have been tried.
+
+- *message(message)*
+
+ Fired when a message arrives from the server
+
+- *close*
+
+ Fired when the connection is closed. Be careful with using this event, as some transports will fire it even under temporary, expected disconnections (such as XHR-Polling).
+
+- *disconnect*
+
+ Fired when the connection is considered disconnected.
+
+- *reconnect(transport_type,reconnectionAttempts)*
+
+ Fired when the connection has been re-established. This only fires if the `reconnect` option is set.
+
+- *reconnecting(reconnectionDelay,reconnectionAttempts)*
+
+ Fired when a reconnection is attempted, passing the next delay for the next reconnection.
+
+- *reconnect_failed*
+
+ Fired when all reconnection attempts have failed and we where unsuccessful in reconnecting to the server.
+
+### Contributors
+
+Guillermo Rauch <guillermo@learnboost.com>
+
+Arnout Kazemier <info@3rd-eden.com>
+
+### License
+
+(The MIT License)
+
+Copyright (c) 2010 LearnBoost <dev@learnboost.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.
View
285 node/server/node_modules/socket.io-client/bin/builder.js
@@ -0,0 +1,285 @@
+/*!
+ * socket.io-node
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var fs = require('fs')
+ , socket = require('../lib/io')
+ , uglify = require('uglify-js');
+
+/**
+ * License headers.
+ *
+ * @api private
+ */
+
+var template = '/*! Socket.IO.%ext% build:' + socket.version + ', %type%. Copyright(c) 2011 LearnBoost <dev@learnboost.com> MIT Licensed */\n'
+ , development = template.replace('%type%', 'development').replace('%ext%', 'js')
+ , production = template.replace('%type%', 'production').replace('%ext%', 'min.js');
+
+/**
+ * If statements, these allows you to create serveride & client side compatible
+ * code using specially designed `if` statements that remove serverside
+ * designed code from the source files
+ *
+ * @api private
+ */
+
+var starttagIF = '// if node'
+ , endtagIF = '// end node';
+
+/**
+ * The modules that are required to create a base build of Socket.IO.
+ *
+ * @const
+ * @type {Array}
+ * @api private
+ */
+
+var base = [
+ 'io.js'
+ , 'util.js'
+ , 'events.js'
+ , 'json.js'
+ , 'parser.js'
+ , 'transport.js'
+ , 'socket.js'
+ , 'namespace.js'
+ ];
+
+/**
+ * The available transports for Socket.IO. These are mapped as:
+ *
+ * - `key` the name of the transport
+ * - `value` the dependencies for the transport
+ *
+ * @const
+ * @type {Object}
+ * @api public
+ */
+
+var baseTransports = {
+ 'websocket': ['transports/websocket.js']
+ , 'flashsocket': [
+ 'transports/websocket.js'
+ , 'transports/flashsocket.js'
+ , 'vendor/web-socket-js/swfobject.js'
+ , 'vendor/web-socket-js/web_socket.js'
+ ]
+ , 'htmlfile': ['transports/xhr.js', 'transports/htmlfile.js']
+ /* FIXME: re-enable me once we have multi-part support
+ , 'xhr-multipart': ['transports/xhr.js', 'transports/xhr-multipart.js'] */
+ , 'xhr-polling': ['transports/xhr.js', 'transports/xhr-polling.js']
+ , 'jsonp-polling': [
+ 'transports/xhr.js'
+ , 'transports/xhr-polling.js'
+ , 'transports/jsonp-polling.js'
+ ]
+};
+
+/**
+ * Builds a custom Socket.IO distribution based on the transports that you
+ * need. You can configure the build to create development build or production
+ * build (minified).
+ *
+ * @param {Array} transports The transports that needs to be bundled.
+ * @param {Object} [options] Options to configure the building process.
+ * @param {Function} callback Last argument should always be the callback
+ * @callback {String|Boolean} err An optional argument, if it exists than an error
+ * occurred during the build process.
+ * @callback {String} result The result of the build process.
+ * @api public
+ */
+
+var builder = module.exports = function () {
+ var transports, options, callback, error = null
+ , args = Array.prototype.slice.call(arguments, 0)
+ , settings = {
+ minify: true
+ , node: false
+ , custom: []
+ };
+
+ // Fancy pancy argument support this makes any pattern possible mainly
+ // because we require only one of each type
+ args.forEach(function (arg) {
+ var type = Object.prototype.toString.call(arg)
+ .replace(/\[object\s(\w+)\]/gi , '$1' ).toLowerCase();
+
+ switch (type) {
+ case 'array':
+ return transports = arg;
+ case 'object':
+ return options = arg;
+ case 'function':
+ return callback = arg;
+ }
+ });
+
+ // Add defaults
+ options = options || {};
+ transports = transports || Object.keys(baseTransports);
+
+ // Merge the data
+ for(var option in options) {
+ settings[option] = options[option];
+ }
+
+ // Start creating a dependencies chain with all the required files for the
+ // custom Socket.IO bundle.
+ var files = [];
+ base.forEach(function (file) {
+ files.push(__dirname + '/../lib/' + file);
+ });
+
+ transports.forEach(function (transport) {
+ var dependencies = baseTransports[transport];
+ if (!dependencies) {
+ error = 'Unsupported transport `' + transport + '` supplied as argument.';
+ return;
+ }
+
+ // Add the files to the files list, but only if they are not added before
+ dependencies.forEach(function (file) {
+ var path = __dirname + '/../lib/' + file;
+ if (!~files.indexOf(path)) files.push(path);
+ })
+ });
+
+ // check to see if the files tree compilation generated any errors.
+ if (error) return callback(error);
+
+ var results = {};
+ files.forEach(function (file) {
+ fs.readFile(file, function (err, content) {
+ if (err) error = err;
+ results[file] = content;
+
+ // check if we are done yet, or not.. Just by checking the size of the result
+ // object.
+ if (Object.keys(results).length !== files.length) return;
+
+ // we are done, did we error?
+ if (error) return callback(error);
+
+ // concatinate the file contents in order
+ var code = development
+ , ignore = 0;
+
+ files.forEach(function (file) {
+ code += results[file];
+ });
+
+ // check if we need to add custom code
+ if (settings.custom.length) {
+ settings.custom.forEach(function (content) {
+ code += content;
+ });
+ }
+
+ // Search for conditional code blocks that need to be removed as they
+ // where designed for a server side env. but only if we don't want to
+ // make this build node compatible.
+ if (!settings.node) {
+ code = code.split('\n').filter(function (line) {
+ // check if there are tags in here
+ var start = line.indexOf(starttagIF) >= 0
+ , end = line.indexOf(endtagIF) >= 0
+ , ret = ignore;
+
+ // ignore the current line
+ if (start) {
+ ignore++;
+ ret = ignore;
+ }
+
+ // stop ignoring the next line
+ if (end) {
+ ignore--;
+ }
+
+ return ret == 0;
+ }).join('\n');
+ }
+
+ // check if we need to process it any further
+ if (settings.minify) {
+ // uglify hate unicode chars...
+ var separator = '@@OMGYUCHANGEME@@@';
+ code = code.replace(/(\\ufffd)/g, separator);
+
+ var ast = uglify.parser.parse(code);
+ ast = uglify.uglify.ast_mangle(ast);
+ ast = uglify.uglify.ast_squeeze(ast);
+
+ code = production + uglify.uglify.gen_code(ast);
+
+ // restore the code
+ code = code.replace(new RegExp('('+ separator + ')', 'g'), '\\ufffd');
+ }
+
+ callback(error, code);
+ })
+ })
+};
+
+/**
+ * Builder version is also the current client version
+ * this way we don't have to do another include for the
+ * clients version number and we can just include the builder.
+ *
+ * @type {String}
+ * @api public
+ */
+
+builder.version = socket.version;
+
+/**
+ * A list of all build in transport types.
+ *
+ * @type {Object}
+ * @api public
+ */
+
+builder.transports = baseTransports;
+
+/**
+ * Command line support, this allows us to generate builds without having
+ * to load it as module.
+ */
+
+if (!module.parent){
+ // the first 2 are `node` and the path to this file, we don't need them
+ var args = process.argv.slice(2);
+
+ // build a development build
+ builder(args.length ? args : false, { minify:false }, function (err, content) {
+ if (err) return console.error(err);
+
+ fs.write(
+ fs.openSync(__dirname + '/../dist/socket.io.js', 'w')
+ , content
+ , 0
+ , 'utf8'
+ );
+ console.log('Successfully generated the development build: socket.io.js');
+ });
+
+ // and build a production build
+ builder(args.length ? args : false, function (err, content) {
+ if (err) return console.error(err);
+
+ fs.write(
+ fs.openSync(__dirname + '/../dist/socket.io.min.js', 'w')
+ , content
+ , 0
+ , 'utf8'
+ );
+ console.log('Successfully generated the production build: socket.io.min.js');
+ });
+}
View
BIN  node/server/node_modules/socket.io-client/dist/WebSocketMain.swf
Binary file not shown
View
BIN  node/server/node_modules/socket.io-client/dist/WebSocketMainInsecure.swf
Binary file not shown
View
3,707 node/server/node_modules/socket.io-client/dist/socket.io.js
@@ -0,0 +1,3707 @@
+/*! Socket.IO.js build:0.8.5, development. Copyright(c) 2011 LearnBoost <dev@learnboost.com> MIT Licensed */
+
+/**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+(function (exports) {
+
+ /**
+ * IO namespace.
+ *
+ * @namespace
+ */
+
+ var io = exports;
+
+ /**
+ * Socket.IO version
+ *
+ * @api public
+ */
+
+ io.version = '0.8.5';
+
+ /**
+ * Protocol implemented.
+ *
+ * @api public
+ */
+
+ io.protocol = 1;
+
+ /**
+ * Available transports, these will be populated with the available transports
+ *
+ * @api public
+ */
+
+ io.transports = [];
+
+ /**
+ * Keep track of jsonp callbacks.
+ *
+ * @api private
+ */
+
+ io.j = [];
+
+ /**
+ * Keep track of our io.Sockets
+ *
+ * @api private
+ */
+ io.sockets = {};
+
+
+ /**
+ * Manages connections to hosts.
+ *
+ * @param {String} uri
+ * @Param {Boolean} force creation of new socket (defaults to false)
+ * @api public
+ */
+
+ io.connect = function (host, details) {
+ var uri = io.util.parseUri(host)
+ , uuri
+ , socket;
+
+ if ('undefined' != typeof document) {
+ uri.protocol = uri.protocol || document.location.protocol.slice(0, -1);
+ uri.host = uri.host || document.domain;
+ uri.port = uri.port || document.location.port;
+ }
+
+ uuri = io.util.uniqueUri(uri);
+
+ var options = {
+ host: uri.host
+ , secure: 'https' == uri.protocol
+ , port: uri.port || ('https' == uri.protocol ? 443 : 80)
+ , query: uri.query || ''
+ };
+
+ io.util.merge(options, details);
+
+ if (options['force new connection'] || !io.sockets[uuri]) {
+ socket = new io.Socket(options);
+ }
+
+ if (!options['force new connection'] && socket) {
+ io.sockets[uuri] = socket;
+ }
+
+ socket = socket || io.sockets[uuri];
+
+ // if path is different from '' or /
+ return socket.of(uri.path.length > 1 ? uri.path : '');
+ };
+
+})('object' === typeof module ? module.exports : (window.io = {}));
+
+/**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+(function (exports, global) {
+
+ /**
+ * Utilities namespace.
+ *
+ * @namespace
+ */
+
+ var util = exports.util = {};
+
+ /**
+ * Parses an URI
+ *
+ * @author Steven Levithan <stevenlevithan.com> (MIT license)
+ * @api public
+ */
+
+ var re = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
+
+ var parts = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password',
+ 'host', 'port', 'relative', 'path', 'directory', 'file', 'query',
+ 'anchor'];
+
+ util.parseUri = function (str) {
+ var m = re.exec(str || '')
+ , uri = {}
+ , i = 14;
+
+ while (i--) {
+ uri[parts[i]] = m[i] || '';
+ }
+
+ return uri;
+ };
+
+ /**
+ * Produces a unique url that identifies a Socket.IO connection.
+ *
+ * @param {Object} uri
+ * @api public
+ */
+
+ util.uniqueUri = function (uri) {
+ var protocol = uri.protocol
+ , host = uri.host
+ , port = uri.port;
+
+ if ('document' in global) {
+ host = host || document.domain;
+ port = port || (protocol == 'https'
+ && document.location.protocol !== 'https:' ? 443 : document.location.port);
+ } else {
+ host = host || 'localhost';
+
+ if (!port && protocol == 'https') {
+ port = 443;
+ }
+ }
+
+ return (protocol || 'http') + '://' + host + ':' + (port || 80);
+ };
+
+ /**
+ * Mergest 2 query strings in to once unique query string
+ *
+ * @param {String} base
+ * @param {String} addition
+ * @api public
+ */
+
+ util.query = function (base, addition) {
+ var query = util.chunkQuery(base || '')
+ , components = [];
+
+ util.merge(query, util.chunkQuery(addition || ''));
+ for (var part in query) {
+ if (query.hasOwnProperty(part)) {
+ components.push(part + '=' + query[part]);
+ }
+ }
+
+ return components.length ? '?' + components.join('&') : '';
+ };
+
+ /**
+ * Transforms a querystring in to an object
+ *
+ * @param {String} qs
+ * @api public
+ */
+
+ util.chunkQuery = function (qs) {
+ var query = {}
+ , params = qs.split('&')
+ , i = 0
+ , l = params.length
+ , kv;
+
+ for (; i < l; ++i) {
+ kv = params[i].split('=');
+ if (kv[0]) {
+ query[kv[0]] = decodeURIComponent(kv[1]);
+ }
+ }
+
+ return query;
+ };
+
+ /**
+ * Executes the given function when the page is loaded.
+ *
+ * io.util.load(function () { console.log('page loaded'); });
+ *
+ * @param {Function} fn
+ * @api public
+ */
+
+ var pageLoaded = false;
+
+ util.load = function (fn) {
+ if ('document' in global && document.readyState === 'complete' || pageLoaded) {
+ return fn();
+ }
+
+ util.on(global, 'load', fn, false);
+ };
+
+ /**
+ * Adds an event.
+ *
+ * @api private
+ */
+
+ util.on = function (element, event, fn, capture) {
+ if (element.attachEvent) {
+ element.attachEvent('on' + event, fn);
+ } else if (element.addEventListener) {
+ element.addEventListener(event, fn, capture);
+ }
+ };
+
+ /**
+ * Generates the correct `XMLHttpRequest` for regular and cross domain requests.
+ *
+ * @param {Boolean} [xdomain] Create a request that can be used cross domain.
+ * @returns {XMLHttpRequest|false} If we can create a XMLHttpRequest.
+ * @api private
+ */
+
+ util.request = function (xdomain) {
+
+ if ('undefined' != typeof window) {
+ if (xdomain && window.XDomainRequest) {
+ return new XDomainRequest();
+ }
+
+ if (window.XMLHttpRequest && (!xdomain || util.ua.hasCORS)) {
+ return new XMLHttpRequest();
+ }
+
+ if (!xdomain) {
+ try {
+ return new window.ActiveXObject('Microsoft.XMLHTTP');
+ } catch(e) { }
+ }
+ }
+
+ return null;
+ };
+
+ /**
+ * XHR based transport constructor.
+ *
+ * @constructor
+ * @api public
+ */
+
+ /**
+ * Change the internal pageLoaded value.
+ */
+
+ if ('undefined' != typeof window) {
+ util.load(function () {
+ pageLoaded = true;
+ });
+ }
+
+ /**
+ * Defers a function to ensure a spinner is not displayed by the browser
+ *
+ * @param {Function} fn
+ * @api public
+ */
+
+ util.defer = function (fn) {
+ if (!util.ua.webkit) {
+ return fn();
+ }
+
+ util.load(function () {
+ setTimeout(fn, 100);
+ });
+ };
+
+ /**
+ * Merges two objects.
+ *
+ * @api public
+ */
+
+ util.merge = function merge (target, additional, deep, lastseen) {
+ var seen = lastseen || []
+ , depth = typeof deep == 'undefined' ? 2 : deep
+ , prop;
+
+ for (prop in additional) {
+ if (additional.hasOwnProperty(prop) && util.indexOf(seen, prop) < 0) {
+ if (typeof target[prop] !== 'object' || !depth) {
+ target[prop] = additional[prop];
+ seen.push(additional[prop]);
+ } else {
+ util.merge(target[prop], additional[prop], depth - 1, seen);
+ }
+ }
+ }
+
+ return target;
+ };
+
+ /**
+ * Merges prototypes from objects
+ *
+ * @api public
+ */
+
+ util.mixin = function (ctor, ctor2) {
+ util.merge(ctor.prototype, ctor2.prototype);
+ };
+
+ /**
+ * Shortcut for prototypical and static inheritance.
+ *
+ * @api private
+ */
+
+ util.inherit = function (ctor, ctor2) {
+ function f() {};
+ f.prototype = ctor2.prototype;
+ ctor.prototype = new f;
+ };
+
+ /**
+ * Checks if the given object is an Array.
+ *
+ * io.util.isArray([]); // true
+ * io.util.isArray({}); // false
+ *
+ * @param Object obj
+ * @api public
+ */
+
+ util.isArray = Array.isArray || function (obj) {
+ return Object.prototype.toString.call(obj) === '[object Array]';
+ };
+
+ /**
+ * Intersects values of two arrays into a third
+ *
+ * @api public
+ */
+
+ util.intersect = function (arr, arr2) {
+ var ret = []
+ , longest = arr.length > arr2.length ? arr : arr2
+ , shortest = arr.length > arr2.length ? arr2 : arr;
+
+ for (var i = 0, l = shortest.length; i < l; i++) {
+ if (~util.indexOf(longest, shortest[i]))
+ ret.push(shortest[i]);
+ }
+
+ return ret;
+ }
+
+ /**
+ * Array indexOf compatibility.
+ *
+ * @see bit.ly/a5Dxa2
+ * @api public
+ */
+
+ util.indexOf = function (arr, o, i) {
+ if (Array.prototype.indexOf) {
+ return Array.prototype.indexOf.call(arr, o, i);
+ }
+
+ for (var j = arr.length, i = i < 0 ? i + j < 0 ? 0 : i + j : i || 0;
+ i < j && arr[i] !== o; i++);
+
+ return j <= i ? -1 : i;
+ };
+
+ /**
+ * Converts enumerables to array.
+ *
+ * @api public
+ */
+
+ util.toArray = function (enu) {
+ var arr = [];
+
+ for (var i = 0, l = enu.length; i < l; i++)
+ arr.push(enu[i]);
+
+ return arr;
+ };
+
+ /**
+ * UA / engines detection namespace.
+ *
+ * @namespace
+ */
+
+ util.ua = {};
+
+ /**
+ * Whether the UA supports CORS for XHR.
+ *
+ * @api public
+ */
+
+ util.ua.hasCORS = 'undefined' != typeof window && window.XMLHttpRequest &&
+ (function () {
+ try {
+ var a = new XMLHttpRequest();
+ } catch (e) {
+ return false;
+ }
+
+ return a.withCredentials != undefined;
+ })();
+
+ /**
+ * Detect webkit.
+ *
+ * @api public
+ */
+
+ util.ua.webkit = 'undefined' != typeof navigator
+ && /webkit/i.test(navigator.userAgent);
+
+})(
+ 'undefined' != typeof window ? io : module.exports
+ , this
+);
+
+/**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+(function (exports, io) {
+
+ /**
+ * Expose constructor.
+ */
+
+ exports.EventEmitter = EventEmitter;
+
+ /**
+ * Event emitter constructor.
+ *
+ * @api public.
+ */
+
+ function EventEmitter () {};
+
+ /**
+ * Adds a listener
+ *
+ * @api public
+ */
+
+ EventEmitter.prototype.on = function (name, fn) {
+ if (!this.$events) {
+ this.$events = {};
+ }
+
+ if (!this.$events[name]) {
+ this.$events[name] = fn;
+ } else if (io.util.isArray(this.$events[name])) {
+ this.$events[name].push(fn);
+ } else {
+ this.$events[name] = [this.$events[name], fn];
+ }
+
+ return this;
+ };
+
+ EventEmitter.prototype.addListener = EventEmitter.prototype.on;
+
+ /**
+ * Adds a volatile listener.
+ *
+ * @api public
+ */
+
+ EventEmitter.prototype.once = function (name, fn) {
+ var self = this;
+
+ function on () {
+ self.removeListener(name, on);
+ fn.apply(this, arguments);
+ };
+
+ on.listener = fn;
+ this.on(name, on);
+
+ return this;
+ };
+
+ /**
+ * Removes a listener.
+ *
+ * @api public
+ */
+
+ EventEmitter.prototype.removeListener = function (name, fn) {
+ if (this.$events && this.$events[name]) {
+ var list = this.$events[name];
+
+ if (io.util.isArray(list)) {
+ var pos = -1;
+
+ for (var i = 0, l = list.length; i < l; i++) {
+ if (list[i] === fn || (list[i].listener && list[i].listener === fn)) {
+ pos = i;
+ break;
+ }
+ }
+
+ if (pos < 0) {
+ return this;
+ }
+
+ list.splice(pos, 1);
+
+ if (!list.length) {
+ delete this.$events[name];
+ }
+ } else if (list === fn || (list.listener && list.listener === fn)) {
+ delete this.$events[name];
+ }
+ }
+
+ return this;
+ };
+
+ /**
+ * Removes all listeners for an event.
+ *
+ * @api public
+ */
+
+ EventEmitter.prototype.removeAllListeners = function (name) {
+ // TODO: enable this when node 0.5 is stable
+ //if (name === undefined) {
+ //this.$events = {};
+ //return this;
+ //}
+
+ if (this.$events && this.$events[name]) {
+ this.$events[name] = null;
+ }
+
+ return this;
+ };
+
+ /**
+ * Gets all listeners for a certain event.
+ *
+ * @api publci
+ */
+
+ EventEmitter.prototype.listeners = function (name) {
+ if (!this.$events) {
+ this.$events = {};
+ }
+
+ if (!this.$events[name]) {
+ this.$events[name] = [];
+ }
+
+ if (!io.util.isArray(this.$events[name])) {
+ this.$events[name] = [this.$events[name]];
+ }
+
+ return this.$events[name];
+ };
+
+ /**
+ * Emits an event.
+ *
+ * @api public
+ */
+
+ EventEmitter.prototype.emit = function (name) {
+ if (!this.$events) {
+ return false;
+ }
+
+ var handler = this.$events[name];
+
+ if (!handler) {
+ return false;
+ }
+
+ var args = Array.prototype.slice.call(arguments, 1);
+
+ if ('function' == typeof handler) {
+ handler.apply(this, args);
+ } else if (io.util.isArray(handler)) {
+ var listeners = handler.slice();
+
+ for (var i = 0, l = listeners.length; i < l; i++) {
+ listeners[i].apply(this, args);
+ }
+ } else {
+ return false;
+ }
+
+ return true;
+ };
+
+})(
+ 'undefined' != typeof io ? io : module.exports
+ , 'undefined' != typeof io ? io : module.parent.exports
+);
+
+/**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+/**
+ * Based on JSON2 (http://www.JSON.org/js.html).
+ */
+
+(function (exports, nativeJSON) {
+ "use strict";
+
+ // use native JSON if it's available
+ if (nativeJSON && nativeJSON.parse){
+ return exports.JSON = {
+ parse: nativeJSON.parse
+ , stringify: nativeJSON.stringify
+ }
+ }
+
+ var JSON = exports.JSON = {};
+
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ function date(d, key) {
+ return isFinite(d.valueOf()) ?
+ d.getUTCFullYear() + '-' +
+ f(d.getUTCMonth() + 1) + '-' +
+ f(d.getUTCDate()) + 'T' +
+ f(d.getUTCHours()) + ':' +
+ f(d.getUTCMinutes()) + ':' +
+ f(d.getUTCSeconds()) + 'Z' : null;
+ };
+
+ var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ gap,
+ indent,
+ meta = { // table of character substitutions
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '"' : '\\"',
+ '\\': '\\\\'
+ },
+ rep;
+
+
+ function quote(string) {
+
+// If the string contains no control characters, no quote characters, and no
+// backslash characters, then we can safely slap some quotes around it.
+// Otherwise we must also replace the offending characters with safe escape
+// sequences.
+
+ escapable.lastIndex = 0;
+ return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
+ var c = meta[a];
+ return typeof c === 'string' ? c :
+ '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ }) + '"' : '"' + string + '"';
+ }
+
+
+ function str(key, holder) {
+
+// Produce a string from holder[key].
+
+ var i, // The loop counter.
+ k, // The member key.
+ v, // The member value.
+ length,
+ mind = gap,
+ partial,
+ value = holder[key];
+
+// If the value has a toJSON method, call it to obtain a replacement value.
+
+ if (value instanceof Date) {
+ value = date(key);
+ }
+
+// If we were called with a replacer function, then call the replacer to
+// obtain a replacement value.
+
+ if (typeof rep === 'function') {
+ value = rep.call(holder, key, value);
+ }
+
+// What happens next depends on the value's type.
+
+ switch (typeof value) {
+ case 'string':
+ return quote(value);
+
+ case 'number':
+
+// JSON numbers must be finite. Encode non-finite numbers as null.
+
+ return isFinite(value) ? String(value) : 'null';
+
+ case 'boolean':
+ case 'null':
+
+// If the value is a boolean or null, convert it to a string. Note:
+// typeof null does not produce 'null'. The case is included here in
+// the remote chance that this gets fixed someday.
+
+ return String(value);
+
+// If the type is 'object', we might be dealing with an object or an array or
+// null.
+
+ case 'object':
+
+// Due to a specification blunder in ECMAScript, typeof null is 'object',
+// so watch out for that case.
+
+ if (!value) {
+ return 'null';
+ }
+
+// Make an array to hold the partial results of stringifying this object value.
+
+ gap += indent;
+ partial = [];
+
+// Is the value an array?
+
+ if (Object.prototype.toString.apply(value) === '[object Array]') {
+
+// The value is an array. Stringify every element. Use null as a placeholder
+// for non-JSON values.
+
+ length = value.length;
+ for (i = 0; i < length; i += 1) {
+ partial[i] = str(i, value) || 'null';
+ }
+
+// Join all of the elements together, separated with commas, and wrap them in
+// brackets.
+
+ v = partial.length === 0 ? '[]' : gap ?
+ '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' :
+ '[' + partial.join(',') + ']';
+ gap = mind;
+ return v;
+ }
+
+// If the replacer is an array, use it to select the members to be stringified.
+
+ if (rep && typeof rep === 'object') {
+ length = rep.length;
+ for (i = 0; i < length; i += 1) {
+ if (typeof rep[i] === 'string') {
+ k = rep[i];
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ } else {
+
+// Otherwise, iterate through all of the keys in the object.
+
+ for (k in value) {
+ if (Object.prototype.hasOwnProperty.call(value, k)) {
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ }
+
+// Join all of the member texts together, separated with commas,
+// and wrap them in braces.
+
+ v = partial.length === 0 ? '{}' : gap ?
+ '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' :
+ '{' + partial.join(',') + '}';
+ gap = mind;
+ return v;
+ }
+ }
+
+// If the JSON object does not yet have a stringify method, give it one.
+
+ JSON.stringify = function (value, replacer, space) {
+
+// The stringify method takes a value and an optional replacer, and an optional
+// space parameter, and returns a JSON text. The replacer can be a function
+// that can replace values, or an array of strings that will select the keys.
+// A default replacer method can be provided. Use of the space parameter can
+// produce text that is more easily readable.
+
+ var i;
+ gap = '';
+ indent = '';
+
+// If the space parameter is a number, make an indent string containing that
+// many spaces.
+
+ if (typeof space === 'number') {
+ for (i = 0; i < space; i += 1) {
+ indent += ' ';
+ }
+
+// If the space parameter is a string, it will be used as the indent string.
+
+ } else if (typeof space === 'string') {
+ indent = space;
+ }
+
+// If there is a replacer, it must be a function or an array.
+// Otherwise, throw an error.
+
+ rep = replacer;
+ if (replacer && typeof replacer !== 'function' &&
+ (typeof replacer !== 'object' ||
+ typeof replacer.length !== 'number')) {
+ throw new Error('JSON.stringify');
+ }
+
+// Make a fake root object containing our value under the key of ''.
+// Return the result of stringifying the value.
+
+ return str('', {'': value});
+ };
+
+// If the JSON object does not yet have a parse method, give it one.
+
+ JSON.parse = function (text, reviver) {
+ // The parse method takes a text and an optional reviver function, and returns
+ // a JavaScript value if the text is a valid JSON text.
+
+ var j;
+
+ function walk(holder, key) {
+
+ // The walk method is used to recursively walk the resulting structure so
+ // that modifications can be made.
+
+ var k, v, value = holder[key];
+ if (value && typeof value === 'object') {
+ for (k in value) {
+ if (Object.prototype.hasOwnProperty.call(value, k)) {
+ v = walk(value, k);
+ if (v !== undefined) {
+ value[k] = v;
+ } else {
+ delete value[k];
+ }
+ }
+ }
+ }
+ return reviver.call(holder, key, value);
+ }
+
+
+ // Parsing happens in four stages. In the first stage, we replace certain
+ // Unicode characters with escape sequences. JavaScript handles many characters
+ // incorrectly, either silently deleting them, or treating them as line endings.
+
+ text = String(text);
+ cx.lastIndex = 0;
+ if (cx.test(text)) {
+ text = text.replace(cx, function (a) {
+ return '\\u' +
+ ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ });
+ }
+
+ // In the second stage, we run the text against regular expressions that look
+ // for non-JSON patterns. We are especially concerned with '()' and 'new'
+ // because they can cause invocation, and '=' because it can cause mutation.
+ // But just to be safe, we want to reject all unexpected forms.
+
+ // We split the second stage into 4 regexp operations in order to work around
+ // crippling inefficiencies in IE's and Safari's regexp engines. First we
+ // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
+ // replace all simple value tokens with ']' characters. Third, we delete all
+ // open brackets that follow a colon or comma or that begin the text. Finally,
+ // we look to see that the remaining characters are only whitespace or ']' or
+ // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
+
+ if (/^[\],:{}\s]*$/
+ .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
+ .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
+ .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
+
+ // In the third stage we use the eval function to compile the text into a
+ // JavaScript structure. The '{' operator is subject to a syntactic ambiguity
+ // in JavaScript: it can begin a block or an object literal. We wrap the text
+ // in parens to eliminate the ambiguity.
+
+ j = eval('(' + text + ')');
+
+ // In the optional fourth stage, we recursively walk the new structure, passing
+ // each name/value pair to a reviver function for possible transformation.
+
+ return typeof reviver === 'function' ?
+ walk({'': j}, '') : j;
+ }
+
+ // If the text is not JSON parseable, then a SyntaxError is thrown.
+
+ throw new SyntaxError('JSON.parse');
+ };
+
+})(
+ 'undefined' != typeof io ? io : module.exports
+ , typeof JSON !== 'undefined' ? JSON : undefined
+);
+
+/**
+ * socket.io
+ * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+(function (exports, io) {
+
+ /**
+ * Parser namespace.
+ *
+ * @namespace
+ */
+
+ var parser = exports.parser = {};
+
+ /**
+ * Packet types.
+ */
+
+ var packets = parser.packets = [
+ 'disconnect'
+ , 'connect'
+ , 'heartbeat'
+ , 'message'
+ , 'json'
+ , 'event'
+ , 'ack'
+ , 'error'
+ , 'noop'
+ ];
+
+ /**
+ * Errors reasons.
+ */
+
+ var reasons = parser.reasons = [
+ 'transport not supported'
+ , 'client not handshaken'
+ , 'unauthorized'
+ ];
+
+ /**
+ * Errors advice.
+ */
+
+ var advice = parser.advice = [
+ 'reconnect'
+ ];
+
+ /**
+ * Shortcuts.
+ */
+
+ var JSON = io.JSON
+ , indexOf = io.util.indexOf;
+
+ /**
+ * Encodes a packet.
+ *
+ * @api private
+ */
+
+ parser.encodePacket = function (packet) {
+ var type = indexOf(packets, packet.type)
+ , id = packet.id || ''
+ , endpoint = packet.endpoint || ''
+ , ack = packet.ack
+ , data = null;
+
+ switch (packet.type) {
+ case 'error':
+ var reason = packet.reason ? indexOf(reasons, packet.reason) : ''
+ , adv = packet.advice ? indexOf(advice, packet.advice) : '';
+
+ if (reason !== '' || adv !== '')
+ data = reason + (adv !== '' ? ('+' + adv) : '');
+
+ break;
+
+ case 'message':
+ if (packet.data !== '')
+ data = packet.data;
+ break;
+
+ case 'event':
+ var ev = { name: packet.name };
+
+ if (packet.args && packet.args.length) {
+ ev.args = packet.args;
+ }
+
+ data = JSON.stringify(ev);
+ break;
+
+ case 'json':
+ data = JSON.stringify(packet.data);
+ break;
+
+ case 'connect':
+ if (packet.qs)
+ data = packet.qs;
+ break;
+
+ case 'ack':
+ data = packet.ackId
+ + (packet.args && packet.args.length
+ ? '+' + JSON.stringify(packet.args) : '');
+ break;
+ }
+
+ // construct packet with required fragments
+ var encoded = [
+ type
+ , id + (ack == 'data' ? '+' : '')
+ , endpoint
+ ];
+
+ // data fragment is optional
+ if (data !== null && data !== undefined)
+ encoded.push(data);
+
+ return encoded.join(':');
+ };
+
+ /**
+ * Encodes multiple messages (payload).
+ *
+ * @param {Array} messages
+ * @api private
+ */
+
+ parser.encodePayload = function (packets) {
+ var decoded = '';
+
+ if (packets.length == 1)
+ return packets[0];
+
+ for (var i = 0, l = packets.length; i < l; i++) {
+ var packet = packets[i];
+ decoded += '\ufffd' + packet.length + '\ufffd' + packets[i];
+ }
+
+ return decoded;
+ };
+
+ /**
+ * Decodes a packet
+ *
+ * @api private
+ */
+
+ var regexp = /([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/;
+
+ parser.decodePacket = function (data) {
+ var pieces = data.match(regexp);
+
+ if (!pieces) return {};
+
+ var id = pieces[2] || ''
+ , data = pieces[5] || ''
+ , packet = {
+ type: packets[pieces[1]]
+ , endpoint: pieces[4] || ''
+ };
+
+ // whether we need to acknowledge the packet
+ if (id) {
+ packet.id = id;
+ if (pieces[3])
+ packet.ack = 'data';
+ else
+ packet.ack = true;
+ }
+
+ // handle different packet types
+ switch (packet.type) {
+ case 'error':
+ var pieces = data.split('+');
+ packet.reason = reasons[pieces[0]] || '';
+ packet.advice = advice[pieces[1]] || '';
+ break;
+
+ case 'message':
+ packet.data = data || '';
+ break;
+
+ case 'event':
+ try {
+ var opts = JSON.parse(data);
+ packet.name = opts.name;
+ packet.args = opts.args;
+ } catch (e) { }
+
+ packet.args = packet.args || [];
+ break;
+
+ case 'json':
+ try {
+ packet.data = JSON.parse(data);
+ } catch (e) { }
+ break;
+
+ case 'connect':
+ packet.qs = data || '';
+ break;
+
+ case 'ack':
+ var pieces = data.match(/^([0-9]+)(\+)?(.*)/);
+ if (pieces) {
+ packet.ackId = pieces[1];
+ packet.args = [];
+
+ if (pieces[3]) {
+ try {
+ packet.args = pieces[3] ? JSON.parse(pieces[3]) : [];
+ } catch (e) { }
+ }
+ }
+ break;
+
+ case 'disconnect':
+ case 'heartbeat':
+ break;
+ };
+
+ return packet;
+ };
+
+ /**
+ * Decodes data payload. Detects multiple messages
+ *
+ * @return {Array} messages
+ * @api public
+ */
+
+ parser.decodePayload = function (data) {
+ // IE doesn't like data[i] for unicode chars, charAt works fine
+ if (data.charAt(0) == '\ufffd') {
+ var ret = [];
+
+ for (var i = 1, length = ''; i < data.length; i++) {
+ if (data.charAt(i) == '\ufffd') {
+ ret.push(parser.decodePacket(data.substr(i + 1).substr(0, length)));
+ i += Number(length) + 1;
+ length = '';
+ } else {
+ length += data.charAt(i);
+ }
+ }
+
+ return ret;
+ } else {
+ return [parser.decodePacket(data)];
+ }
+ };
+
+})(
+ 'undefined' != typeof io ? io : module.exports
+ , 'undefined' != typeof io ? io : module.parent.exports
+);
+