Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of https://github.com/crcastle/Squeenote into c…

…rcastle-master
  • Loading branch information...
commit 6d18cdb8e795ad5bdecda2d4e6688dd5c958be7b 2 parents c528c89 + 5708a41
@danski authored
Showing with 39,166 additions and 544 deletions.
  1. +2 −3 node-lib/squeenote/server.js
  2. BIN  node-lib/squeenote/vendor/socket.io/.DS_Store
  3. +8 −0 node-lib/squeenote/vendor/socket.io/.gitignore
  4. +205 −0 node-lib/squeenote/vendor/socket.io/History.md
  5. +13 −0 node-lib/squeenote/vendor/socket.io/Makefile
  6. +229 −0 node-lib/squeenote/vendor/socket.io/README.md
  7. +21 −0 node-lib/squeenote/vendor/socket.io/example/cert.crt
  8. +61 −0 node-lib/squeenote/vendor/socket.io/example/chat-ssl.html
  9. +61 −0 node-lib/squeenote/vendor/socket.io/example/chat.html
  10. +18 −0 node-lib/squeenote/vendor/socket.io/example/json.js
  11. +27 −0 node-lib/squeenote/vendor/socket.io/example/key.key
  12. +66 −0 node-lib/squeenote/vendor/socket.io/example/server-ssl.js
  13. +63 −0 node-lib/squeenote/vendor/socket.io/example/server.js
  14. +186 −0 node-lib/squeenote/vendor/socket.io/lib/socket.io/client.js
  15. +26 −0 node-lib/squeenote/vendor/socket.io/lib/socket.io/index.js
  16. +166 −0 node-lib/squeenote/vendor/socket.io/lib/socket.io/listener.js
  17. +89 −0 node-lib/squeenote/vendor/socket.io/lib/socket.io/transports/flashsocket.js
  18. +49 −0 node-lib/squeenote/vendor/socket.io/lib/socket.io/transports/htmlfile.js
  19. +35 −0 node-lib/squeenote/vendor/socket.io/lib/socket.io/transports/jsonp-polling.js
  20. +211 −0 node-lib/squeenote/vendor/socket.io/lib/socket.io/transports/websocket.js
  21. +67 −0 node-lib/squeenote/vendor/socket.io/lib/socket.io/transports/xhr-multipart.js
  22. +80 −0 node-lib/squeenote/vendor/socket.io/lib/socket.io/transports/xhr-polling.js
  23. +52 −0 node-lib/squeenote/vendor/socket.io/lib/socket.io/utils.js
  24. +17 −0 node-lib/squeenote/vendor/socket.io/package.json
  25. +1 −9 node-lib/squeenote/vendor/socket.io/socket.io.js
  26. +0 −100 node-lib/squeenote/vendor/socket.io/socket.io/client.js
  27. +0 −123 node-lib/squeenote/vendor/socket.io/socket.io/listener.js
  28. +0 −25 node-lib/squeenote/vendor/socket.io/socket.io/transports/flashsocket.js
  29. +0 −41 node-lib/squeenote/vendor/socket.io/socket.io/transports/htmlfile.js
  30. +0 −65 node-lib/squeenote/vendor/socket.io/socket.io/transports/websocket.js
  31. +0 −48 node-lib/squeenote/vendor/socket.io/socket.io/transports/xhr-multipart.js
  32. +0 −48 node-lib/squeenote/vendor/socket.io/socket.io/transports/xhr-polling.js
  33. +0 −16 node-lib/squeenote/vendor/socket.io/socket.io/util/array.js
  34. +0 −38 node-lib/squeenote/vendor/socket.io/socket.io/util/object.js
  35. +0 −28 node-lib/squeenote/vendor/socket.io/socket.io/util/options.js
  36. +3 −0  node-lib/squeenote/vendor/socket.io/support/expresso/.gitignore
  37. +3 −0  node-lib/squeenote/vendor/socket.io/support/expresso/.gitmodules
  38. +128 −0 node-lib/squeenote/vendor/socket.io/support/expresso/History.md
  39. +53 −0 node-lib/squeenote/vendor/socket.io/support/expresso/Makefile
  40. +61 −0 node-lib/squeenote/vendor/socket.io/support/expresso/Readme.md
  41. +856 −0 node-lib/squeenote/vendor/socket.io/support/expresso/bin/expresso
  42. +339 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/COPYING
  43. +81 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/Makefile.am
  44. +884 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/Makefile.in
  45. +8 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/Readme.md
  46. +872 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/aclocal.m4
  47. +1,526 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/config.guess
  48. +92 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/config.h.in
  49. +666 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/config.rpath
  50. +1,658 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/config.sub
  51. +7,971 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/configure
  52. +88 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/configure.ac
  53. +589 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/depcomp
  54. +87 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/demo.html
  55. +45 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/doc.css
  56. +25 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-inverted/index.html
  57. +20 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-inverted/script.js
  58. +50 −0 ...ueenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/css/jsUnitStyle.css
  59. +10 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/css/readme
  60. +11 −0 ...ib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/emptyPage.html
  61. +534 −0 ...lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/jsUnitCore.js
  62. +81 −0 ...eenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/jsUnitMockTimeout.js
  63. +705 −0 ...eenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/jsUnitTestManager.js
  64. +44 −0 ...queenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/jsUnitTestSuite.js
  65. +102 −0 ...b/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/jsUnitTracer.js
  66. +59 −0 ...enote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/jsUnitVersionCheck.js
  67. +12 −0 ...ote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/main-counts-errors.html
  68. +13 −0 ...e/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/main-counts-failures.html
  69. +13 −0 ...enote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/main-counts-runs.html
  70. +21 −0 .../squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/main-counts.html
  71. +189 −0 ...ib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/main-data.html
  72. +23 −0 .../squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/main-errors.html
  73. +19 −0 ...b/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/main-frame.html
  74. +45 −0 .../squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/main-loader.html
  75. +25 −0 ...queenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/main-progress.html
  76. +67 −0 ...squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/main-results.html
  77. +13 −0 .../squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/main-status.html
  78. +16 −0 ...queenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/testContainer.html
  79. +77 −0 ...endor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/testContainerController.html
  80. +306 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/xbDebug.js
  81. +83 −0 ...b/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/css/jsUnitStyle.css
  82. BIN  ...-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/images/green.gif
  83. BIN  ...queenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/images/logo_jsunit.gif
  84. BIN  .../vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/images/powerby-transparent.gif
  85. BIN  node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/images/red.gif
  86. +56 −0 ...enote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/licenses/JDOM_license.txt
  87. +213 −0 ...ote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/licenses/Jetty_license.html
  88. +470 −0 .../squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/licenses/MPL-1.1.txt
  89. +340 −0 ...ib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/licenses/gpl-2.txt
  90. +141 −0 ...b/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/licenses/index.html
  91. +504 −0 ...squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/licenses/lgpl-2.1.txt
  92. +35 −0 .../vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/licenses/mpl-tri-license-c.txt
  93. +35 −0 ...ndor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/licenses/mpl-tri-license-html.txt
  94. +19 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/readme.txt
  95. +167 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/testRunner.html
  96. +7 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/script.js
  97. +25 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example-jsunit/test.html
  98. +24 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example/index.html
  99. +20 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/example/script.js
  100. +164 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/faq.html
  101. BIN  node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/feed-icon-14x14.png
  102. +45 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/help.html
  103. +151 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/index.html
  104. +25 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented-inverted/index.html
  105. +38 −0 ...eenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented-inverted/jscoverage-highlight.css
  106. +89 −0 ...lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented-inverted/jscoverage-ie.css
  107. BIN  ...ueenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented-inverted/jscoverage-throbber.gif
  108. +328 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented-inverted/jscoverage.css
  109. +125 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented-inverted/jscoverage.html
  110. +1,024 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented-inverted/jscoverage.js
  111. +65 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented-inverted/script.js
  112. +24 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented/index.html
  113. +38 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented/jscoverage-highlight.css
  114. +89 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented/jscoverage-ie.css
  115. BIN  node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented/jscoverage-throbber.gif
  116. +328 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented/jscoverage.css
  117. +125 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented/jscoverage.html
  118. +1,024 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented/jscoverage.js
  119. +65 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/instrumented/script.js
  120. +382 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/license.html
  121. +59 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/links.html
  122. +701 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/manual.html
  123. +214 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/news.html
  124. +7 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/reset-fonts-grids.css
  125. BIN  node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/screenshot.png
  126. BIN  node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/screenshot2.png
  127. BIN  node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/screenshot3.png
  128. BIN  node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/screenshot4.png
  129. BIN  node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/screenshot5.png
  130. BIN  node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/screenshot6.png
  131. BIN  node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/screenshot7.png
  132. +1 −0  node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/sh_html.min.js
  133. +1 −0  node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/sh_javascript.min.js
  134. +4 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/sh_main.min.js
  135. +1 −0  node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/sh_nedit.min.css
  136. BIN  node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/siliconforks-16x16.png
  137. +138 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/style.css
  138. +58 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/doc/users.html
  139. +315 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/encoding.c
  140. +33 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/encoding.h
  141. +58 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/generate-resources.c
  142. +29 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/global.h
  143. +478 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/highlight.c
  144. +37 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/highlight.h
  145. +192 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/http-connection.c
  146. +494 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/http-exchange.c
  147. +95 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/http-host.c
  148. +900 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/http-message.c
  149. +236 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/http-server.c
  150. +208 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/http-server.h
  151. +156 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/http-url.c
  152. +519 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/install-sh
  153. +1,873 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/instrument-js.cpp
  154. +81 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/instrument-js.h
  155. +226 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/instrument.c
  156. +31 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/instrument.h
  157. +15 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/GNUmakefile
  158. +483 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/Makefile.ref
  159. +54 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/README.html
  160. +11 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/SpiderMonkey.rsp
  161. +9 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/aclocal.m4
  162. +5 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/bench.sh
  163. +202 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/autoconf/acoutput-fast.pl
  164. +154 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/autoconf/altoptions.m4
  165. +1,481 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/autoconf/config.guess
  166. +1,595 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/autoconf/config.sub
  167. +119 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/autoconf/install-sh
  168. +315 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/autoconf/make-makefile
  169. +101 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/autoconf/match-dir.sh
  170. +82 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/autoconf/nspr.m4
  171. +59 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/autoconf/pkg.m4
  172. +118 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/autoconf/update-makefile.sh
  173. +75 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/cygwin-wrapper
  174. +111 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/hcc
  175. +155 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/hcpp
  176. +165 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/unix/mddepend.pl
  177. +63 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/unix/uniq.pl
  178. +40 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/build/win32/pgomerge.py
  179. +98 −0 node-lib/squeenote/vendor/socket.io/support/expresso/deps/jscoverage/js/builtins.tbl
Sorry, we could not display the entire diff because too many files (965) changed.
View
5 node-lib/squeenote/server.js
@@ -74,8 +74,8 @@ Server = this.Server = Class({
staticFileResponse: function(req, res) {
var request_info = url.parse(req.url);
sys.puts("Serving static file: "+request_info.href);
- if(request_info.href.indexOf("/public") != 0) return denyResponse(req, res, "Static file requested outside of public directory");
- if(request_info.href.indexOf("..") > -1) return denyResponse(req, res, "Illegal static file path");
+ if(request_info.href.indexOf("/public") != 0) return this.denyResponse(req, res, "Static file requested outside of public directory");
+ if(request_info.href.indexOf("..") > -1) return this.denyResponse(req, res, "Illegal static file path");
fs.readFile("."+request_info.href, function(error, data) {
if(error) return this.notFoundResponse(req, res);
res.writeHead(200, {});
@@ -118,7 +118,6 @@ Server = this.Server = Class({
broadcast_response = {};
presenter_authenticated = (message.presenter_password == this.presenter_password);
-
// Sync local state for authenticated messages
if(message.presenter_password != null) {
client_response.authentication_attempted = true;
View
BIN  node-lib/squeenote/vendor/socket.io/.DS_Store
Binary file not shown
View
8 node-lib/squeenote/vendor/socket.io/.gitignore
@@ -0,0 +1,8 @@
+.DS_Store
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
View
205 node-lib/squeenote/vendor/socket.io/History.md
@@ -0,0 +1,205 @@
+
+0.6.11 / 2011-02-15
+===================
+
+ * Fixed; Make sure to not execute any other connection operations after WebSocket
+ write error.
+ * Added more error logging
+
+0.6.10 / 2011-02-09
+===================
+
+ * Added SSL chat example (`make example-ssl`)
+ * Fixed; possible write errors when a connection error event fires
+
+0.6.9 / 2011-02-06
+==================
+
+ * 0.3 compatibility
+ * Updated socket.io client to 0.6.2
+ * Fixed Flash inline policy serving for Firefox 4
+ * Updated expresso
+ * Added comments and version number to socket.io/index
+
+0.6.8 / 2011-01-10
+==================
+
+ * Fixed issue with terminating connection twice
+
+0.6.7 / 2011-01-09
+==================
+
+ * Fixed situation where the connection drops but the client can still autoreconnect
+ through a different socket. In this case we still want to clear the FD but not
+ call onDisconnect immediately.
+
+0.6.6 / 2011-01-09
+==================
+
+ * Note for Flash socket and inline policy on Firefox
+ * Destroy the fds on disconnect
+ * Restored 20 secs of polling so that node doesn't timeout the connections
+
+0.6.5 / 2011-01-09
+==================
+
+ * Make sure not to trigger multiple timeouts when closing
+ * Important fix for polling transports.
+
+0.6.4 / 2011-01-05
+==================
+
+ * Don't destroy the connection in _onClose. Destroying it will prevent the buffers from being flushed and will result in corrupted responses for the xhr-polling transport.
+ * Added try/catch block around JSON.parse and return an empty object literal if JSON parsing fails.
+ * Added missing .connect() to example
+
+0.6.3 / 2010-12-23
+==================
+
+ * Changed polling default duration to 50 seconds
+ * might > will Adjusted to 85 column limit
+ * Support for resources that include slashes. Thanks @schamane
+ * Lazy loading of transports. Thanks @technoweenie Fixed README transports list
+ * OpenSSL clarifications (thanks @bmnds)
+ * Support for HAProxy load balancing (thanks Brian McKelvey) Backported Parser from 0.7
+ * Fixed HTTP API in example (was outdated). Thanks deedubs
+ * 0.3 compatibility (thanks Arnout)
+ * `client.broadcast` now 300% faster Cleaned up chat example
+ * fixed bad pluralization.
+ * cleaned up grammar, missing punctuation, etc.
+ * Restored global `netserver` for flashsocket Now supporting `flashPolicyServer` option (thanks Arnout) Tests passing with and without sudo/root user Fixed noDelay/timeout/utf-8 for draft 76 (accidental typo)
+ * Close the netServer when the main http server closes, this way the event loop does not keep running. NOTE: this is patch for node 0.2.X, this is not required for node 0.3.X
+ * Fallback to try{}catch handling for node < 0.2.4 , node 0.3.X seems to capture the errors correctly using the error event.
+ * Added the flash policy server, it's enabled by default but can be turned off if needed. Socket.io will automatically fallback to serving the policy file inline if server is disabled or unable to start up.
+ * Make sure to only write to open transports (thanks JohnDav)
+ * _open is still false, so destroy the connection immediately upon websocket error
+ * Make sure .connection is not null on 'end'
+ * Proper fix for invalid websocket key
+
+0.6.1 / 2010-11-08
+
+ * Restored flash policy server, but with these changes:
+ - It's contingent on the listener flashPolicyServer option
+ - It's started by default if socket.io is started with root access
+ - It correctly closes the netserver upon all the dependent http servers being closed
+ - The handler for the inline request is still there regardless. This is important in the following circumstances, and has no performance hit
+ - The port 843 is filtered
+ - Flash at some point enables us to skip 843 checking altogether
+ - Tests compatibility
+ * Fixed connection timeout, noDelay and socket encoding for draft 76 (had been accidentally moved into the `else` block)
+ * Some stylistic fixes
+
+0.6.0 / 2010-11-01
+==================
+
+ * Make sure to only write to open transports (thanks JohnDav)
+ * _open is still false, so destroy the connection immediately upon websocket error
+ * Make sure to disconnect directly onClose if the client is not handshaked and he can't possibly reconnect
+ * Make sure to end and destroy connection onDisconnect (for timeouts)
+ * Added missing .listen() call to example. Fixes #80. Thanks @machee
+ * Invalid transport test completed
+ * Initial stab at trying to detect invalid transport responses
+ * Make sure to provide a default for `log` if no log key was provided (internal)
+ * Removed unnecessary file extension verification when serving the client
+ * Removed unnecessary Client check upon connection
+ * Added support for /socket.io/WebSocketMain.swf
+ * Added test for /socket.io/WebSocketMain.swf
+ * Client serving ETag testing
+ * Added htmlfile transport tests
+ * Added extra byte to IE iframe bytes padding
+ * Invalid session id test
+ * end() before destroy()ing the socket for non-WebSocket or non-valid Upgrade requests
+ * Added test for non-socket.io requests
+ * Simplified index.js tests
+ * Moved listener tests into listener.js
+ * Make sure to call .end() when listening on connection 'end' event
+ * Make sure the file descriptor is destroyed on disconnection
+ * Fix for websocket client tracking test
+ * Inline (same port) flash socket policy request.
+ * If the server is not run with root privileges, then the flashsocket
+ transport will instead listen to all new connections on the main port
+ for policy requests. Flash policy requests happen to both port 843 and
+ the destination port:
+ http://www.lightsphere.com/dev/articles/flash_socket_policy.html
+
+ * [websocket test] Fix sending message to client upon connecting
+ * [websocket test] Fix for connection and handshake test
+ * [client files serving] Leverage end() write() call
+ * [client serving] Make sure to not do a useless file lookup when file is cached
+ * Finished json encoding test
+ * Look for the heartbeat in the decoded message
+ * Refactored websocket transports tests to match polling/multipart helpers
+ * Added coverage testing to Makefile
+ * Added heartbeat test to multipart
+ * Added buffered messages test for multipart
+ * Added assertions for `connected` property for all the tests
+ * Multipart clients tracking test
+ * Multipart client>server message sending test
+ * Make sure to only close the client stream when the roundtrip is complete
+ * Multipart connection and handshake tests:
+ - Implemented HTTP client on top of net.Stream with multipart boundary parsing for testing
+ - Test for connection / server>client message sending
+ * Removed unnecessary check for this.connection (since we now access the socket through req.connection for all transports)
+ * Test for `duration` parameter
+ * Added `make example` to Makefile
+ * Added clients tracking test for long polling
+ * Added message buffering test for long polling
+ * Improve this.request/this.response/this.connection
+ * Add 'end' listener onConnect, applies to all transports
+ * Improved error handling onConnect
+ * Remove legacy `flush` calls
+ * Removed unnecessary closeTimeout clearing in jsonp polling
+ * Make sure to close on disconnect if _open = true
+ * Clear disconnection timeout on disconnection (double check)
+ * Make sure to clear closeTimeout for polling transports on close.
+ * Replaced empty with null in log option
+ * Comma first style for client serving tests
+ * Long polling integration tests
+ * Test for heartbeat message
+ * Added heartbeat timeout test
+ * Support for listener#log false
+ * Corrected onConnect signature to support a request and a socket, or a request and a response.
+ * Removed error checking for non-upgradeable sockets, since they'll be destroyed, and error handling is done onConnect
+ * Added tests for websocket client tracking
+ * Added tests for websocket message buffering
+ * Make sure disconnect timeout is cleared on websocket re-connect
+ * Updated the flash socket with error detection, and readystate detection.
+ * This is needed because when a error occures we close down the connection,
+ * and the stream will become unwriteable.
+ * Also changed to a single write instead of multiple writes.
+ * Moved error handling to onConnect to avoid messing with the http.Server global error handlers
+ * Do special error handling for websocket
+ * Clearing heartbeat interval upon closing the connection
+ * Added error listeners, if theses errors are not correcly caught, they will leak memory.
+ * This caused http://speedo.no.de/ to go up from 1mb per connection after a ECONNECTRESET message
+ * Added encode=UTF-8 in jsonp-polling.js and xhr-polling.js since UTF-8 is the default encoding for http.ServerResponse.write
+ * Replaced string.length with Buffer.byteLength in jsonp-polling.js, listener.js and xhr-polling.js because content-length header requires number of bytes and not the number of symbols in string
+ * Fix COR headers/requests for different ports on Safari.
+ * Clearing the references to request, response and connection upon disconnect.
+ * Every require is blocking and requiring the sys module over and over and over again just makes no sense + it hurt performance.. Not to mention.. that it's already included.
+ * Socket.IO-node now serves the client out of the box for easier implementation
+ * Memory caching and ETag support for static files
+ * Tests
+ * Simplified demo even further thanks to new static file serving
+ * Failing to pass an origin header would throw an exception and crash the server. Added some handling.
+ * .connected renamed to ._open, and adopted proper `connected` (fixes #41)
+ * example/client updated to latest socket.io client
+ * Better checking of WebSocket connections
+ * Better handling of SSL location (thanks @jdub)
+ * Fix for cross-domain websocket (fixes #42)
+ * Removed clients/clientsIndex and only using the index (fixes #28)
+ * Fixed WebSocket location header for ws/wss (Thanks @jdub, Fixes #40)
+ * Cross domain issues with xhr-polling addressed. Thanks Niko Kaiser (@nicokaiser)
+ * Added origin verification for incoming data.
+ * Make sure pathname is set (thanks steadicat & swarmation team)
+ * Fix for accessing routes that being with the namespace but are not a connection attempt. Thanks @steadicat from swarmation
+ * JSONP-polling support
+ * Graceful closing of connection for invalid websocket clients
+ * Make it possible to just require 'socket.io'
+ * Make sure to abort the connect() method upon bad upgrade / origin verification
+ * Support for automatic JSON encoding/decoding
+ * Simplified chat example to take advantage of JSON encoding/decoding
+ * Removed fs sync call from example
+ * Better `how to use`
+ * Make sure to send content-type text/plain to `ok` POST responses
+
View
13 node-lib/squeenote/vendor/socket.io/Makefile
@@ -0,0 +1,13 @@
+test:
+ ./support/expresso/bin/expresso -I lib $(TESTFLAGS) tests/*.js
+
+test-cov:
+ @TESTFLAGS=--cov $(MAKE) test
+
+example:
+ node ./example/server.js
+
+example-ssl:
+ node ./example/server-ssl.js
+
+.PHONY: example
View
229 node-lib/squeenote/vendor/socket.io/README.md
@@ -0,0 +1,229 @@
+Socket.IO Server: Sockets for the rest of us
+============================================
+
+The `Socket.IO` server provides seamless support for a variety of transports intended for realtime communication.
+
+- WebSocket
+- WebSocket over Flash (+ XML security policy support)
+- XHR Polling
+- XHR Multipart Streaming
+- Forever Iframe
+- JSONP Polling (for cross domain)
+
+## Requirements
+
+- Node v0.1.103+ with `crypto` module support (make sure you have OpenSSL
+ headers when installing Node to get it)
+- The [Socket.IO client](http://github.com/LearnBoost/Socket.IO), to connect from the browser
+
+## How to use
+
+To run the demo, execute the following:
+
+ git clone git://github.com/LearnBoost/Socket.IO-node.git socket.io
+ cd socket.io/example/
+ sudo node server.js
+
+and point your browser to `http://localhost:8080`. In addition to `8080`, if the transport `flashsocket` is enabled, a server will be initialized to listen for requests on port `843`.
+
+### Implementing it on your project
+
+`Socket.IO` is designed not to take over an entire port or Node `http.Server` instance. This means that if you choose to have your HTTP server listen on port `80`, `socket.io` can intercept requests directed to it, and normal requests will still be served.
+
+By default, the server will intercept requests that contain `socket.io` in the path / resource part of the URI. You can change this as shown in the available options below.
+
+On the server:
+
+ var http = require('http'),
+ io = require('./path/to/socket.io'),
+
+ server = http.createServer(function(req, res){
+ // your normal server code
+ res.writeHead(200, {'Content-Type': 'text/html'});
+ res.end('<h1>Hello world</h1>');
+ });
+
+ server.listen(80);
+
+ // socket.io, I choose you
+ var socket = io.listen(server);
+
+ socket.on('connection', function(client){
+ // new client is here!
+ client.on('message', function(){ … })
+ client.on('disconnect', function(){ … })
+ });
+
+On the client:
+
+ <script src="/socket.io/socket.io.js"></script>
+ <script>
+ var socket = new io.Socket();
+ socket.connect();
+ socket.on('connect', function(){ … })
+ socket.on('message', function(){ … })
+ socket.on('disconnect', function(){ … })
+ </script>
+
+The [client-side](http://github.com/learnboost/socket.io) files are served automatically by `Socket.IO-node`.
+
+## Documentation
+
+### Listener
+
+ io.listen(<http.Server>, [options])
+
+Returns: a `Listener` instance
+
+Public Properties:
+
+- *server*
+
+ An instance of _process.http.Server_.
+
+- *options*
+
+ The passed-in options, combined with the defaults.
+
+- *clients*
+
+ An object of clients, indexed by session ID.
+
+Methods:
+
+- *addListener(event, λ)*
+
+ Adds a listener for the specified event. Optionally, you can pass it as an option to `io.listen`, prefixed by `on`. For example: `onClientConnect: function(){}`
+
+- *removeListener(event, λ)*
+
+ Removes a listener from the listener array for the specified event.
+
+- *broadcast(message, [except])*
+
+ Broadcasts a message to all clients. Optionally, you can pass a single session ID or array of session IDs to avoid broadcasting to, as the second argument.
+
+Options:
+
+- *resource*
+
+ socket.io
+
+ The resource is what allows the `socket.io` server to identify incoming connections from `socket.io` clients. Make sure they're in sync.
+
+- *flashPolicyServer*
+
+ true
+
+ Create a Flash Policy file server on port `843` (this is restricted port and you will need to have root permission). If you disable the FlashPolicy file server, Socket.IO will automatically fall back to serving the policy file inline.
+
+
+- *transports*
+
+ ['websocket', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling',
+ 'jsonp-polling']
+
+ A list of the accepted transports.
+
+- *transportOptions*
+
+ An object of options to pass to each transport. For example `{ websocket: { closeTimeout: 8000 }}`
+
+- *log*
+
+ ƒ(){ sys.log }
+
+ The logging function. Defaults to outputting to `stdout` through `sys.log`
+
+Events:
+
+- *clientConnect(client)*
+
+ Fired when a client is connected. Receives the Client instance as parameter.
+
+- *clientMessage(message, client)*
+
+ Fired when a message from a client is received. Receives the message and Client instance as parameters.
+
+- *clientDisconnect(client)*
+
+ Fired when a client is disconnected. Receives the Client instance as a parameter.
+
+Important note: `this` in the event listener refers to the `Listener` instance.
+
+### Client
+
+ Client(listener, req, res)
+
+Public Properties:
+
+- *listener*
+
+ The `Listener` instance to which this client belongs.
+
+- *connected*
+
+ Whether the client is connected.
+
+- *connections*
+
+ Number of times the client has connected.
+
+Methods:
+
+- *send(message)*
+
+ Sends a message to the client.
+
+- *broadcast(message)*
+
+ Sends a message to all other clients. Equivalent to Listener::broadcast(message, client.sessionId).
+
+## Protocol
+
+One of the design goals is that you should be able to implement whatever protocol you desire without `Socket.IO` getting in the way. `Socket.IO` has a minimal, unobtrusive protocol layer, consisting of two parts:
+
+* Connection handshake
+
+ This is required to simulate a full duplex socket with transports such as XHR Polling or Server-sent Events (which is a "one-way socket"). The basic idea is that the first message received from the server will be a JSON object that contains a session ID used for further communications exchanged between the client and server.
+
+ The concept of session also naturally benefits a full-duplex WebSocket, in the event of an accidental disconnection and a quick reconnection. Messages that the server intends to deliver to the client are cached temporarily until reconnection.
+
+ The implementation of reconnection logic (potentially with retries) is left for the user. By default, transports that are keep-alive or open all the time (like WebSocket) have a timeout of 0 if a disconnection is detected.
+
+* Message batching
+
+ Messages are buffered in order to optimize resources. In the event of the server trying to send multiple messages while a client is temporarily disconnected (eg: xhr polling), the messages are stacked and then encoded in a lightweight way, and sent to the client whenever it becomes available.
+
+Despite this extra layer, the messages are delivered unaltered to the various event listeners. You can `JSON.stringify()` objects, send XML, or even plain text.
+
+## Credits
+
+- Guillermo Rauch &lt;guillermo@learnboost.com&gt; ([Guille](http://github.com/guille))
+
+- Arnout Kazemier ([3rd-Eden](http://github.com/3rd-Eden))
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2010 LearnBoost &lt;dev@learnboost.com&gt;
+
+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
21 node-lib/squeenote/vendor/socket.io/example/cert.crt
@@ -0,0 +1,21 @@
+-----BEGIN CERTIFICATE-----
+MIIDXTCCAkWgAwIBAgIJAMUSOvlaeyQHMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
+BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
+aWRnaXRzIFB0eSBMdGQwHhcNMTAxMTE2MDkzMjQ5WhcNMTMxMTE1MDkzMjQ5WjBF
+MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50
+ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEAz+LXZOjcQCJq3+ZKUFabj71oo/ex/XsBcFqtBThjjTw9CVEVwfPQQp4X
+wtPiB204vnYXwQ1/R2NdTQqCZu47l79LssL/u2a5Y9+0NEU3nQA5qdt+1FAE0c5o
+exPimXOrR3GWfKz7PmZ2O0117IeCUUXPG5U8umhDe/4mDF4ZNJiKc404WthquTqg
+S7rLQZHhZ6D0EnGnOkzlmxJMYPNHSOY1/6ivdNUUcC87awNEA3lgfhy25IyBK3QJ
+c+aYKNTbt70Lery3bu2wWLFGtmNiGlQTS4JsxImRsECTI727ObS7/FWAQsqW+COL
+0Sa5BuMFrFIpjPrEe0ih7vRRbdmXRwIDAQABo1AwTjAdBgNVHQ4EFgQUDnV4d6mD
+tOnluLoCjkUHTX/n4agwHwYDVR0jBBgwFoAUDnV4d6mDtOnluLoCjkUHTX/n4agw
+DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAFwV4MQfTo+qMv9JMiyno
+IEiqfOz4RgtmBqRnXUffcjS2dhc7/z+FPZnM79Kej8eLHoVfxCyWRHFlzm93vEdv
+wxOCrD13EDOi08OOZfxWyIlCa6Bg8cMAKqQzd2OvQOWqlRWBTThBJIhWflU33izX
+Qn5GdmYqhfpc+9ZHHGhvXNydtRQkdxVK2dZNzLBvBlLlRmtoClU7xm3A+/5dddeP
+AQHEPtyFlUw49VYtZ3ru6KqPms7MKvcRhYLsy9rwSfuuniMlx4d0bDR7TOkw0QQS
+A0N8MGQRQpzl4mw4jLzyM5d5QtuGBh2P6hPGa0YQxtI3RPT/p6ENzzBiAKXiSfzo
+xw==
+-----END CERTIFICATE-----
View
61 node-lib/squeenote/vendor/socket.io/example/chat-ssl.html
@@ -0,0 +1,61 @@
+<!doctype html>
+<html>
+ <head>
+ <title>socket.io client test</title>
+
+ <script src="/json.js"></script> <!-- for ie -->
+ <script src="/socket.io/socket.io.js"></script>
+ </head>
+ <body>
+
+ <script>
+ function message(obj){
+ var el = document.createElement('p');
+ if ('announcement' in obj) el.innerHTML = '<em>' + esc(obj.announcement) + '</em>';
+ else if ('message' in obj) el.innerHTML = '<b>' + esc(obj.message[0]) + ':</b> ' + esc(obj.message[1]);
+ document.getElementById('chat').appendChild(el);
+ document.getElementById('chat').scrollTop = 1000000;
+ }
+
+ function send(){
+ var val = document.getElementById('text').value;
+ socket.send(val);
+ message({ message: ['you', val] });
+ document.getElementById('text').value = '';
+ }
+
+ function esc(msg){
+ return msg.replace(/</g, '&lt;').replace(/>/g, '&gt;');
+ };
+
+ var socket = new io.Socket(null, {port: 443, secure: true, rememberTransport: false});
+ socket.connect();
+ socket.on('message', function(obj){
+ if ('buffer' in obj){
+ document.getElementById('form').style.display='block';
+ document.getElementById('chat').innerHTML = '';
+
+ for (var i in obj.buffer) message(obj.buffer[i]);
+ } else message(obj);
+ });
+ </script>
+
+ <h1>Sample chat client</h1>
+ <div id="chat"><p>Connecting...</p></div>
+ <form id="form" onsubmit="send(); return false">
+ <input type="text" autocomplete="off" id="text"><input type="submit" value="Send">
+ </form>
+
+ <style>
+ #chat { height: 300px; overflow: auto; width: 800px; border: 1px solid #eee; font: 13px Helvetica, Arial; }
+ #chat p { padding: 8px; margin: 0; }
+ #chat p:nth-child(odd) { background: #F6F6F6; }
+ #form { width: 782px; background: #333; padding: 5px 10px; display: none; }
+ #form input[type=text] { width: 700px; padding: 5px; background: #fff; border: 1px solid #fff; }
+ #form input[type=submit] { cursor: pointer; background: #999; border: none; padding: 6px 8px; -moz-border-radius: 8px; -webkit-border-radius: 8px; margin-left: 5px; text-shadow: 0 1px 0 #fff; }
+ #form input[type=submit]:hover { background: #A2A2A2; }
+ #form input[type=submit]:active { position: relative; top: 2px; }
+ </style>
+
+ </body>
+</html>
View
61 node-lib/squeenote/vendor/socket.io/example/chat.html
@@ -0,0 +1,61 @@
+<!doctype html>
+<html>
+ <head>
+ <title>socket.io client test</title>
+
+ <script src="/json.js"></script> <!-- for ie -->
+ <script src="/socket.io/socket.io.js"></script>
+ </head>
+ <body>
+
+ <script>
+ function message(obj){
+ var el = document.createElement('p');
+ if ('announcement' in obj) el.innerHTML = '<em>' + esc(obj.announcement) + '</em>';
+ else if ('message' in obj) el.innerHTML = '<b>' + esc(obj.message[0]) + ':</b> ' + esc(obj.message[1]);
+ document.getElementById('chat').appendChild(el);
+ document.getElementById('chat').scrollTop = 1000000;
+ }
+
+ function send(){
+ var val = document.getElementById('text').value;
+ socket.send(val);
+ message({ message: ['you', val] });
+ document.getElementById('text').value = '';
+ }
+
+ function esc(msg){
+ return msg.replace(/</g, '&lt;').replace(/>/g, '&gt;');
+ };
+
+ var socket = new io.Socket(null, {port: 8080, rememberTransport: false});
+ socket.connect();
+ socket.on('message', function(obj){
+ if ('buffer' in obj){
+ document.getElementById('form').style.display='block';
+ document.getElementById('chat').innerHTML = '';
+
+ for (var i in obj.buffer) message(obj.buffer[i]);
+ } else message(obj);
+ });
+ </script>
+
+ <h1>Sample chat client</h1>
+ <div id="chat"><p>Connecting...</p></div>
+ <form id="form" onsubmit="send(); return false">
+ <input type="text" autocomplete="off" id="text"><input type="submit" value="Send">
+ </form>
+
+ <style>
+ #chat { height: 300px; overflow: auto; width: 800px; border: 1px solid #eee; font: 13px Helvetica, Arial; }
+ #chat p { padding: 8px; margin: 0; }
+ #chat p:nth-child(odd) { background: #F6F6F6; }
+ #form { width: 782px; background: #333; padding: 5px 10px; display: none; }
+ #form input[type=text] { width: 700px; padding: 5px; background: #fff; border: 1px solid #fff; }
+ #form input[type=submit] { cursor: pointer; background: #999; border: none; padding: 6px 8px; -moz-border-radius: 8px; -webkit-border-radius: 8px; margin-left: 5px; text-shadow: 0 1px 0 #fff; }
+ #form input[type=submit]:hover { background: #A2A2A2; }
+ #form input[type=submit]:active { position: relative; top: 2px; }
+ </style>
+
+ </body>
+</html>
View
18 node-lib/squeenote/vendor/socket.io/example/json.js
@@ -0,0 +1,18 @@
+if(!this.JSON){JSON=function(){function f(n){return n<10?'0'+n:n;}
+Date.prototype.toJSON=function(){return this.getUTCFullYear()+'-'+
+f(this.getUTCMonth()+1)+'-'+
+f(this.getUTCDate())+'T'+
+f(this.getUTCHours())+':'+
+f(this.getUTCMinutes())+':'+
+f(this.getUTCSeconds())+'Z';};var m={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};function stringify(value,whitelist){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;switch(typeof value){case'string':return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];if(c){return c;}
+c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+
+(c%16).toString(16);})+'"':'"'+value+'"';case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
+if(typeof value.toJSON==='function'){return stringify(value.toJSON());}
+a=[];if(typeof value.length==='number'&&!(value.propertyIsEnumerable('length'))){l=value.length;for(i=0;i<l;i+=1){a.push(stringify(value[i],whitelist)||'null');}
+return'['+a.join(',')+']';}
+if(whitelist){l=whitelist.length;for(i=0;i<l;i+=1){k=whitelist[i];if(typeof k==='string'){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+':'+v);}}}}else{for(k in value){if(typeof k==='string'){v=stringify(value[k],whitelist);if(v){a.push(stringify(k)+':'+v);}}}}
+return'{'+a.join(',')+'}';}}
+return{stringify:stringify,parse:function(text,filter){var j;function walk(k,v){var i,n;if(v&&typeof v==='object'){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);if(n!==undefined){v[i]=n;}}}}
+return filter(k,v);}
+if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof filter==='function'?walk('',j):j;}
+throw new SyntaxError('parseJSON');}};}();}
View
27 node-lib/squeenote/vendor/socket.io/example/key.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAz+LXZOjcQCJq3+ZKUFabj71oo/ex/XsBcFqtBThjjTw9CVEV
+wfPQQp4XwtPiB204vnYXwQ1/R2NdTQqCZu47l79LssL/u2a5Y9+0NEU3nQA5qdt+
+1FAE0c5oexPimXOrR3GWfKz7PmZ2O0117IeCUUXPG5U8umhDe/4mDF4ZNJiKc404
+WthquTqgS7rLQZHhZ6D0EnGnOkzlmxJMYPNHSOY1/6ivdNUUcC87awNEA3lgfhy2
+5IyBK3QJc+aYKNTbt70Lery3bu2wWLFGtmNiGlQTS4JsxImRsECTI727ObS7/FWA
+QsqW+COL0Sa5BuMFrFIpjPrEe0ih7vRRbdmXRwIDAQABAoIBAGe4+9VqZfJN+dsq
+8Osyuz01uQ8OmC0sAWTIqUlQgENIyf9rCJsUBlYmwR5BT6Z69XP6QhHdpSK+TiAR
+XUz0EqG9HYzcxHIBaACP7j6iRoQ8R4kbbiWKo0z3WqQGIOqFjvD/mKEuQdE5mEYw
+eOUCG6BnX1WY2Yr8WKd2AA/tp0/Y4d8z04u9eodMpSTbHTzYMJb5SbBN1vo6FY7q
+8zSuO0BMzXlAxUsCwHsk1GQHFr8Oh3zIR7bQGtMBouI+6Lhh7sjFYsfxJboqMTBV
+IKaA216M6ggHG7MU1/jeKcMGDmEfqQLQoyWp29rMK6TklUgipME2L3UD7vTyAVzz
+xbVOpZkCgYEA8CXW4sZBBrSSrLR5SB+Ubu9qNTggLowOsC/kVKB2WJ4+xooc5HQo
+mFhq1v/WxPQoWIxdYsfg2odlL+JclK5Qcy6vXmRSdAQ5lK9gBDKxZSYc3NwAw2HA
+zyHCTK+I0n8PBYQ+yGcrxu0WqTGnlLW+Otk4CejO34WlgHwbH9bbY5UCgYEA3ZvT
+C4+OoMHXlmICSt29zUrYiL33IWsR3/MaONxTEDuvgkOSXXQOl/8Ebd6Nu+3WbsSN
+bjiPC/JyL1YCVmijdvFpl4gjtgvfJifs4G+QHvO6YfsYoVANk4u6g6rUuBIOwNK4
+RwYxwDc0oysp+g7tPxoSgDHReEVKJNzGBe9NGGsCgYEA4O4QP4gCEA3B9BF2J5+s
+n9uPVxmiyvZUK6Iv8zP4pThTBBMIzNIf09G9AHPQ7djikU2nioY8jXKTzC3xGTHM
+GJZ5m6fLsu7iH+nDvSreDSeNkTBfZqGAvoGYQ8uGE+L+ZuRfCcXYsxIOT5s6o4c3
+Dle2rVFpsuKzCY00urW796ECgYBn3go75+xEwrYGQSer6WR1nTgCV29GVYXKPooy
+zmmMOT1Yw80NSkEw0pFD4cTyqVYREsTrPU0mn1sPfrOXxnGfZSVFpcR/Je9QVfQ7
+eW7GYxwfom335aqHVj10SxRqteP+UoWWnHujCPz94VRKZMakBddYCIGSan+G6YdS
+7sdmwwKBgBc2qj0wvGXDF2kCLwSGfWoMf8CS1+5fIiUIdT1e/+7MfDdbmLMIFVjF
+QKS3zVViXCbrG5SY6wS9hxoc57f6E2A8vcaX6zy2xkZlGHQCpWRtEM5R01OWJQaH
+HsHMmQZGUQVoDm1oRkDhrTFK4K3ukc3rAxzeTZ96utOQN8/KJsTv
+-----END RSA PRIVATE KEY-----
View
66 node-lib/squeenote/vendor/socket.io/example/server-ssl.js
@@ -0,0 +1,66 @@
+/**
+ * Important note: this application is not suitable for benchmarks!
+ */
+
+var https = require('https')
+ , url = require('url')
+ , fs = require('fs')
+ , io = require('../')
+ , sys = require(process.binding('natives').util ? 'util' : 'sys')
+ , server;
+
+server = https.createServer({
+ key: fs.readFileSync(__dirname + '/key.key')
+ , cert: fs.readFileSync(__dirname + '/cert.crt')
+}, function(req, res){
+ // your normal server code
+ var path = url.parse(req.url).pathname;
+ switch (path){
+ case '/':
+ res.writeHead(200, {'Content-Type': 'text/html'});
+ res.write('<h1>Welcome. Try the <a href="/chat-ssl.html">SSL Chat</a> example.</h1>');
+ res.end();
+ break;
+
+ case '/json.js':
+ case '/chat-ssl.html':
+ fs.readFile(__dirname + path, function(err, data){
+ if (err) return send404(res);
+ res.writeHead(200, {'Content-Type': path == 'json.js' ? 'text/javascript' : 'text/html'})
+ res.write(data, 'utf8');
+ res.end();
+ });
+ break;
+
+ default: send404(res);
+ }
+}),
+
+send404 = function(res){
+ res.writeHead(404);
+ res.write('404');
+ res.end();
+};
+
+server.listen(443);
+
+// socket.io, I choose you
+// simplest chat application evar
+var io = io.listen(server)
+ , buffer = [];
+
+io.on('connection', function(client){
+ client.send({ buffer: buffer });
+ client.broadcast({ announcement: client.sessionId + ' connected' });
+
+ client.on('message', function(message){
+ var msg = { message: [client.sessionId, message] };
+ buffer.push(msg);
+ if (buffer.length > 15) buffer.shift();
+ client.broadcast(msg);
+ });
+
+ client.on('disconnect', function(){
+ client.broadcast({ announcement: client.sessionId + ' disconnected' });
+ });
+});
View
63 node-lib/squeenote/vendor/socket.io/example/server.js
@@ -0,0 +1,63 @@
+/**
+ * Important note: this application is not suitable for benchmarks!
+ */
+
+var http = require('http')
+ , url = require('url')
+ , fs = require('fs')
+ , io = require('../')
+ , sys = require(process.binding('natives').util ? 'util' : 'sys')
+ , server;
+
+server = http.createServer(function(req, res){
+ // your normal server code
+ var path = url.parse(req.url).pathname;
+ switch (path){
+ case '/':
+ res.writeHead(200, {'Content-Type': 'text/html'});
+ res.write('<h1>Welcome. Try the <a href="/chat.html">chat</a> example.</h1>');
+ res.end();
+ break;
+
+ case '/json.js':
+ case '/chat.html':
+ fs.readFile(__dirname + path, function(err, data){
+ if (err) return send404(res);
+ res.writeHead(200, {'Content-Type': path == 'json.js' ? 'text/javascript' : 'text/html'})
+ res.write(data, 'utf8');
+ res.end();
+ });
+ break;
+
+ default: send404(res);
+ }
+}),
+
+send404 = function(res){
+ res.writeHead(404);
+ res.write('404');
+ res.end();
+};
+
+server.listen(8080);
+
+// socket.io, I choose you
+// simplest chat application evar
+var io = io.listen(server)
+ , buffer = [];
+
+io.on('connection', function(client){
+ client.send({ buffer: buffer });
+ client.broadcast({ announcement: client.sessionId + ' connected' });
+
+ client.on('message', function(message){
+ var msg = { message: [client.sessionId, message] };
+ buffer.push(msg);
+ if (buffer.length > 15) buffer.shift();
+ client.broadcast(msg);
+ });
+
+ client.on('disconnect', function(){
+ client.broadcast({ announcement: client.sessionId + ' disconnected' });
+ });
+});
View
186 node-lib/squeenote/vendor/socket.io/lib/socket.io/client.js
@@ -0,0 +1,186 @@
+var urlparse = require('url').parse
+ , OutgoingMessage = require('http').OutgoingMessage
+ , Stream = require('net').Stream
+ , options = require('./utils').options
+ , encode = require('./utils').encode
+ , decode = require('./utils').decode
+ , merge = require('./utils').merge
+ , util = require(process.binding('natives').util ? 'util' : 'sys');
+
+var Client = module.exports = function(listener, req, res, options, head){
+ process.EventEmitter.call(this);
+ this.listener = listener;
+ this.options(merge({
+ timeout: 8000,
+ heartbeatInterval: 10000,
+ closeTimeout: 0
+ }, this.getOptions ? this.getOptions() : {}), options);
+ this.connections = 0;
+ this._open = false;
+ this._heartbeats = 0;
+ this.connected = false;
+ this.upgradeHead = head;
+ this._onConnect(req, res);
+};
+
+util.inherits(Client, process.EventEmitter);
+
+Client.prototype.send = function(message){
+ if (!this._open || !(this.connection.readyState === 'open' || this.connection.readyState === 'writeOnly')){
+ return this._queue(message);
+ }
+ this._write(encode(message));
+ return this;
+};
+
+Client.prototype.broadcast = function(message){
+ if (!('sessionId' in this)) return this;
+ this.listener.broadcast(message, this.sessionId);
+ return this;
+};
+
+Client.prototype._onMessage = function(data){
+ var messages = decode(data);
+ if (messages === false) return this.listener.options.log('Bad message received from client ' + this.sessionId);
+ for (var i = 0, l = messages.length, frame; i < l; i++){
+ frame = messages[i].substr(0, 3);
+ switch (frame){
+ case '~h~':
+ return this._onHeartbeat(messages[i].substr(3));
+ case '~j~':
+ try {
+ messages[i] = JSON.parse(messages[i].substr(3));
+ } catch(e) {
+ messages[i] = {};
+ }
+ break;
+ }
+ this.emit('message', messages[i]);
+ this.listener._onClientMessage(messages[i], this);
+ }
+};
+
+Client.prototype._onConnect = function(req, res){
+ var self = this;
+
+ this.request = req;
+ this.response = res;
+ this.connection = req.connection;
+
+ this.connection.addListener('end', function(){
+ self._onClose();
+ if (self.connection)
+ self.connection.destroy();
+ });
+
+ if (req){
+ req.addListener('error', function(err){
+ req.destroy && req.destroy();
+ });
+ if (res) res.addListener('error', function(err){
+ res.destroy && res.destroy();
+ });
+ req.connection.addListener('error', function(err){
+ req.connection.destroy && req.connection.destroy();
+ });
+
+ if (this._disconnectTimeout) clearTimeout(this._disconnectTimeout);
+ }
+};
+
+Client.prototype._payload = function(){
+ var payload = [];
+
+ this.connections++;
+ this.connected = true;
+ this._open = true;
+
+ if (!this.handshaked){
+ this._generateSessionId();
+ payload.push(this.sessionId);
+ this.handshaked = true;
+ }
+
+ payload = payload.concat(this._writeQueue || []);
+ this._writeQueue = [];
+
+ if (payload.length) this._write(encode(payload));
+ if (this.connections === 1) this.listener._onClientConnect(this);
+ if (this.options.timeout) this._heartbeat();
+};
+
+Client.prototype._heartbeat = function(){
+ var self = this;
+ this._heartbeatInterval = setTimeout(function(){
+ self.send('~h~' + ++self._heartbeats);
+ self._heartbeatTimeout = setTimeout(function(){
+ self._onClose();
+ }, self.options.timeout);
+ }, self.options.heartbeatInterval);
+};
+
+Client.prototype._onHeartbeat = function(h){
+ if (h == this._heartbeats){
+ clearTimeout(this._heartbeatTimeout);
+ this._heartbeat();
+ }
+};
+
+Client.prototype._onClose = function(skipDisconnect){
+ if (!this._open) return this;
+ var self = this;
+ if (this._heartbeatInterval) clearTimeout(this._heartbeatInterval);
+ if (this._heartbeatTimeout) clearTimeout(this._heartbeatTimeout);
+ this._open = false;
+ this.request = null;
+ this.response = null;
+ if (skipDisconnect !== false){
+ if (this.handshaked){
+ this._disconnectTimeout = setTimeout(function(){
+ self._onDisconnect();
+ }, this.options.closeTimeout);
+ } else
+ this._onDisconnect();
+ }
+};
+
+Client.prototype._onDisconnect = function(){
+ if (this._open) this._onClose(true);
+ if (this._disconnectTimeout) clearTimeout(this._disconnectTimeout);
+ this._writeQueue = [];
+ this.connected = false;
+ if (this.handshaked){
+ this.emit('disconnect');
+ this.listener._onClientDisconnect(this);
+ this.handshaked = false;
+ }
+};
+
+Client.prototype._queue = function(message){
+ this._writeQueue = this._writeQueue || [];
+ this._writeQueue.push(message);
+ return this;
+};
+
+Client.prototype._generateSessionId = function(){
+ this.sessionId = Math.random().toString().substr(2);
+ return this;
+};
+
+Client.prototype._verifyOrigin = function(origin){
+ var origins = this.listener.options.origins;
+ if (origins.indexOf('*:*') !== -1) {
+ return true;
+ }
+ if (origin) {
+ try {
+ var parts = urlparse(origin);
+ return origins.indexOf(parts.host + ':' + parts.port) !== -1 ||
+ origins.indexOf(parts.host + ':*') !== -1 ||
+ origins.indexOf('*:' + parts.port) !== -1;
+ } catch (ex) {}
+ }
+ return false;
+};
+
+for (var i in options) Client.prototype[i] = options[i];
View
26 node-lib/squeenote/vendor/socket.io/lib/socket.io/index.js
@@ -0,0 +1,26 @@
+
+/**
+ * Listener creation shorcut
+ *
+ * @param {Server} node HTTP server
+ * @param {Object} options
+ * @api public
+ */
+
+exports.listen = function(server, options){
+ return new exports.Listener(server, options);
+};
+
+/**
+ * Listener constructor
+ *
+ * @api public
+ */
+
+exports.Listener = require('./listener');
+
+/**
+ * Version
+ */
+
+exports.version = '0.6.11';
View
166 node-lib/squeenote/vendor/socket.io/lib/socket.io/listener.js
@@ -0,0 +1,166 @@
+var url = require('url')
+ , util = require(process.binding('natives').util ? 'util' : 'sys')
+ , fs = require('fs')
+ , options = require('./utils').options
+ , Client = require('./client')
+ , clientVersion = require('./../../support/socket.io-client/lib/io').io.version
+ , transports = {};
+
+var Listener = module.exports = function(server, options){
+ process.EventEmitter.call(this);
+ var self = this;
+ this.server = server;
+ this.options({
+ origins: '*:*',
+ resource: 'socket.io',
+ flashPolicyServer: true,
+ transports: ['websocket', 'flashsocket', 'htmlfile', 'xhr-multipart',
+ 'xhr-polling', 'jsonp-polling'],
+ transportOptions: {},
+ log: util.log
+ }, options);
+
+ if (!this.options.log) this.options.log = function(){};
+
+ this.clients = this.clientsIndex = {};
+ this._clientCount = 0;
+ this._clientFiles = {};
+
+ var listeners = this.server.listeners('request');
+ this.server.removeAllListeners('request');
+
+ this.server.addListener('request', function(req, res){
+ if (self.check(req, res)) return;
+ for (var i = 0, len = listeners.length; i < len; i++){
+ listeners[i].call(this, req, res);
+ }
+ });
+
+ this.server.addListener('upgrade', function(req, socket, head){
+ if (!self.check(req, socket, true, head)){
+ socket.end();
+ socket.destroy();
+ }
+ });
+
+ this.options.transports.forEach(function(name) {
+ if (!(name in transports))
+ transports[name] = require('./transports/' + name);
+ if ('init' in transports[name]) transports[name].init(self);
+ });
+
+ this.options.log('socket.io ready - accepting connections');
+};
+
+util.inherits(Listener, process.EventEmitter);
+for (var i in options) Listener.prototype[i] = options[i];
+
+Listener.prototype.broadcast = function(message, except){
+ for (var i = 0, k = Object.keys(this.clients), l = k.length; i < l; i++){
+ if (!except || ((typeof except == 'number' || typeof except == 'string') && k[i] != except)
+ || (Array.isArray(except) && except.indexOf(k[i]) == -1)){
+ this.clients[k[i]].send(message);
+ }
+ }
+ return this;
+};
+
+Listener.prototype.check = function(req, res, httpUpgrade, head){
+ var path = url.parse(req.url).pathname, parts, cn;
+ if (path && path.indexOf('/' + this.options.resource) === 0){
+ parts = path.substr(2 + this.options.resource.length).split('/');
+ if (this._serveClient(parts.join('/'), req, res)) return true;
+ if (!(parts[0] in transports)) return false;
+ if (parts[1]){
+ cn = this.clients[parts[1]];
+ if (cn){
+ cn._onConnect(req, res);
+ } else {
+ req.connection.end();
+ req.connection.destroy();
+ this.options.log('Couldnt find client with session id "' + parts[1] + '"');
+ }
+ } else {
+ this._onConnection(parts[0], req, res, httpUpgrade, head);
+ }
+ return true;
+ }
+ return false;
+};
+
+Listener.prototype._serveClient = function(file, req, res){
+ var self = this
+ , clientPaths = {
+ 'socket.io.js': 'socket.io.js',
+ 'lib/vendor/web-socket-js/WebSocketMain.swf': 'lib/vendor/web-socket-js/WebSocketMain.swf', // for compat with old clients
+ 'WebSocketMain.swf': 'lib/vendor/web-socket-js/WebSocketMain.swf'
+ }
+ , types = {
+ swf: 'application/x-shockwave-flash',
+ js: 'text/javascript'
+ };
+
+ function write(path){
+ if (req.headers['if-none-match'] == clientVersion){
+ res.writeHead(304);
+ res.end();
+ } else {
+ res.writeHead(200, self._clientFiles[path].headers);
+ res.end(self._clientFiles[path].content, self._clientFiles[path].encoding);
+ }
+ };
+
+ var path = clientPaths[file];
+
+ if (req.method == 'GET' && path !== undefined){
+ if (path in this._clientFiles){
+ write(path);
+ return true;
+ }
+
+ fs.readFile(__dirname + '/../../support/socket.io-client/' + path, function(err, data){
+ if (err){
+ res.writeHead(404);
+ res.end('404');
+ } else {
+ var ext = path.split('.').pop();
+ self._clientFiles[path] = {
+ headers: {
+ 'Content-Length': data.length,
+ 'Content-Type': types[ext],
+ 'ETag': clientVersion
+ },
+ content: data,
+ encoding: ext == 'swf' ? 'binary' : 'utf8'
+ };
+ write(path);
+ }
+ });
+
+ return true;
+ }
+
+ return false;
+};
+
+Listener.prototype._onClientConnect = function(client){
+ this.clients[client.sessionId] = client;
+ this.options.log('Client '+ client.sessionId +' connected');
+ this.emit('clientConnect', client);
+ this.emit('connection', client);
+};
+
+Listener.prototype._onClientMessage = function(data, client){
+ this.emit('clientMessage', data, client);
+};
+
+Listener.prototype._onClientDisconnect = function(client){
+ delete this.clients[client.sessionId];
+ this.options.log('Client '+ client.sessionId +' disconnected');
+ this.emit('clientDisconnect', client);
+};
+
+Listener.prototype._onConnection = function(transport, req, res, httpUpgrade, head){
+ this.options.log('Initializing client with transport "'+ transport +'"');
+ new transports[transport](this, req, res, this.options.transportOptions[transport], head);
+};
View
89 node-lib/squeenote/vendor/socket.io/lib/socket.io/transports/flashsocket.js
@@ -0,0 +1,89 @@
+var net = require('net')
+ , util = require(process.binding('natives').util ? 'util' : 'sys')
+ , WebSocket = require('./websocket')
+ , listeners = []
+ , netserver;
+
+var Flashsocket = module.exports = function(){
+ WebSocket.apply(this, arguments);
+};
+
+util.inherits(Flashsocket, WebSocket);
+
+Flashsocket.httpUpgrade = true;
+
+Flashsocket.init = function(listener){
+ listeners.push(listener);
+
+ listener.server.on('close', function(){
+ listeners.splice(listeners.indexOf(listener), 1);
+
+ if (listeners.length === 0 && netserver){
+ try {
+ netserver.close();
+ } catch(e){
+ listener.options.log('flashsocket netserver close error - ' + e.stack)
+ }
+ }
+ });
+
+ if (listener.options.flashPolicyServer && netserver === undefined){
+ netserver = net.createServer(function(socket){
+ socket.addListener('error', function(err){
+ if (socket && socket.end){
+ socket.end();
+ socket.destroy();
+ }
+ });
+
+ if(socket && socket.readyState == 'open')
+ socket.end(policy(listeners));
+ });
+
+ try {
+ netserver.listen(843);
+ } catch(e){
+ if (e.errno == 13)
+ listener.options.log('Your node instance does not have root privileges. '
+ + 'This means that the flash XML policy file will be '
+ + 'served inline instead of on port 843. This will slow '
+ + 'down initial connections slightly.');
+ netserver = null;
+ }
+ }
+
+ // Could not listen on port 843 so policy requests will be inline
+ listener.server.addListener('connection', function(stream){
+ var flashCheck = function (data) {
+ // Only check the initial data
+ stream.removeListener("data", flashCheck);
+ if (data[0] === 60 && data.length == 23) {
+ if (data == '<policy-file-request/>\0') {
+ listener.options.log("Answering flash policy request inline");
+ if (stream && stream.readyState == 'open'){
+ var xml = policy([listener]);
+ stream.write(xml);
+ stream.end();
+ }
+ }
+ }
+ };
+
+ stream.on('data', flashCheck);
+ });
+};
+
+function policy(listeners) {
+ var xml = '<?xml version="1.0"?>\n<!DOCTYPE cross-domain-policy SYSTEM'
+ + ' "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">\n<cross-domain-policy>\n';
+
+ listeners.forEach(function(l){
+ [].concat(l.options.origins).forEach(function(origin){
+ var parts = origin.split(':');
+ xml += '<allow-access-from domain="' + parts[0] + '" to-ports="'+ parts[1] +'"/>\n';
+ });
+ });
+
+ xml += '</cross-domain-policy>\n';
+ return xml;
+};
View
49 node-lib/squeenote/vendor/socket.io/lib/socket.io/transports/htmlfile.js
@@ -0,0 +1,49 @@
+var Client = require('../client')
+ , util = require(process.binding('natives').util ? 'util' : 'sys')
+ , qs = require('querystring');
+
+var HTMLFile = module.exports = function(){
+ Client.apply(this, arguments);
+};
+
+util.inherits(HTMLFile, Client);
+
+HTMLFile.prototype._onConnect = function(req, res){
+ var self = this, body = '';
+ switch (req.method){
+ case 'GET':
+ Client.prototype._onConnect.call(this, req, res);
+ this.response.useChunkedEncodingByDefault = true;
+ this.response.shouldKeepAlive = true;
+ this.response.writeHead(200, {
+ 'Content-Type': 'text/html',
+ 'Connection': 'keep-alive',
+ 'Transfer-Encoding': 'chunked'
+ });
+ this.response.write('<html><body>' + new Array(245).join(' '));
+ this._payload();
+ break;
+
+ case 'POST':
+ req.addListener('data', function(message){
+ body += message;
+ });
+ req.addListener('end', function(){
+ try {
+ var msg = qs.parse(body);
+ self._onMessage(msg.data);
+ } catch(e){
+ listener.options.log('htmlfile message handler error - ' + e.stack);
+ }
+ res.writeHead(200, {'Content-Type': 'text/plain'});
+ res.write('ok');
+ res.end();
+ });
+ break;
+ }
+};
+
+HTMLFile.prototype._write = function(message){
+ if (this._open)
+ this.response.write('<script>parent.s._('+ JSON.stringify(message) +', document);</script>'); //json for escaping
+};
View
35 node-lib/squeenote/vendor/socket.io/lib/socket.io/transports/jsonp-polling.js
@@ -0,0 +1,35 @@
+var XHRPolling = require('./xhr-polling')
+ , util = require(process.binding('natives').util ? 'util' : 'sys');
+
+JSONPPolling = module.exports = function(){
+ XHRPolling.apply(this, arguments);
+};
+
+util.inherits(JSONPPolling, XHRPolling);
+
+JSONPPolling.prototype.getOptions = function(){
+ return {
+ timeout: null, // no heartbeats
+ closeTimeout: 8000,
+ duration: 20000
+ };
+};
+
+JSONPPolling.prototype._onConnect = function(req, res){
+ this._index = req.url.match(/\/([0-9]+)\/?$/).pop();
+ XHRPolling.prototype._onConnect.call(this, req, res);
+};
+
+JSONPPolling.prototype._write = function(message){
+ if (this._open){
+ if (this.request.headers.origin && !this._verifyOrigin(this.request.headers.origin)){
+ message = "alert('Cross domain security restrictions not met');";
+ } else {
+ message = "io.JSONP["+ this._index +"]._("+ JSON.stringify(message) +");";
+ }
+ this.response.writeHead(200, {'Content-Type': 'text/javascript; charset=UTF-8', 'Content-Length': Buffer.byteLength(message)});
+ this.response.write(message);
+ this.response.end();
+ this._onClose();
+ }
+};
View
211 node-lib/squeenote/vendor/socket.io/lib/socket.io/transports/websocket.js
@@ -0,0 +1,211 @@
+var Client = require('../client')
+ , Stream = require('net').Stream
+ , EventEmitter = require('events').EventEmitter
+ , url = require('url')
+ , util = require(process.binding('natives').util ? 'util' : 'sys')
+ , crypto = require('crypto');
+
+WebSocket = module.exports = function(){
+ Client.apply(this, arguments);
+};
+
+util.inherits(WebSocket, Client);
+
+WebSocket.prototype._onConnect = function(req, socket){
+ var self = this
+ , headers = [];
+
+ if (!req.connection.setTimeout){
+ req.connection.end();
+ return false;
+ }
+
+ this.parser = new Parser();
+ this.parser.on('data', self._onMessage.bind(this));
+ this.parser.on('error', self._onClose.bind(this));
+
+ Client.prototype._onConnect.call(this, req);
+
+ if (this.request.headers.upgrade !== 'WebSocket' || !this._verifyOrigin(this.request.headers.origin)){
+ this.listener.options.log('WebSocket connection invalid or Origin not verified');
+ this._onClose();
+ return false;
+ }
+
+ var origin = this.request.headers.origin,
+ location = (origin && origin.substr(0, 5) == 'https' ? 'wss' : 'ws')
+ + '://' + this.request.headers.host + this.request.url;
+
+ this.waitingForNonce = false;
+ if ('sec-websocket-key1' in this.request.headers){
+ /* We need to send the 101 response immediately when using Draft 76 with
+ a load balancing proxy, such as HAProxy. In order to protect an
+ unsuspecting non-websocket HTTP server, HAProxy will not send the
+ 8-byte nonce through the connection until the Upgrade: WebSocket
+ request has been confirmed by the WebSocket server by a 101 response
+ indicating that the server can handle the upgraded protocol. We
+ therefore must send the 101 response immediately, and then wait for
+ the nonce to be forwarded to us afterward in order to finish the
+ Draft 76 handshake.
+ */
+
+ // If we don't have the nonce yet, wait for it.
+ if (!(this.upgradeHead && this.upgradeHead.length >= 8)) {
+ this.waitingForNonce = true;
+ }
+
+ headers = [
+ 'HTTP/1.1 101 WebSocket Protocol Handshake',
+ 'Upgrade: WebSocket',
+ 'Connection: Upgrade',
+ 'Sec-WebSocket-Origin: ' + origin,
+ 'Sec-WebSocket-Location: ' + location
+ ];
+
+ if ('sec-websocket-protocol' in this.request.headers){
+ headers.push('Sec-WebSocket-Protocol: ' + this.request.headers['sec-websocket-protocol']);
+ }
+ } else {
+ headers = [
+ 'HTTP/1.1 101 Web Socket Protocol Handshake',
+ 'Upgrade: WebSocket',
+ 'Connection: Upgrade',
+ 'WebSocket-Origin: ' + origin,
+ 'WebSocket-Location: ' + location
+ ];
+
+ }
+
+ try {
+ this.connection.write(headers.concat('', '').join('\r\n'));
+ } catch(e){
+ this._onClose();
+ return;
+ }
+
+ this.connection.setTimeout(0);
+ this.connection.setNoDelay(true);
+ this.connection.setEncoding('utf-8');
+
+ if (this.waitingForNonce) {
+ // Since we will be receiving the binary nonce through the normal HTTP
+ // data event, set the connection to 'binary' temporarily
+ this.connection.setEncoding('binary');
+ this._headers = headers;
+ }
+ else {
+ if (this._proveReception(headers)) this._payload();
+ }
+
+ this.buffer = "";
+
+ this.connection.addListener('data', function(data){
+ self.buffer += data;
+ if (self.waitingForNonce) {
+ if (self.buffer.length < 8) { return; }
+ // Restore the connection to utf8 encoding after receiving the nonce
+ self.connection.setEncoding('utf8');
+ self.waitingForNonce = false;
+ // Stuff the nonce into the location where it's expected to be
+ self.upgradeHead = self.buffer.substr(0,8);
+ self.buffer = self.buffer.substr(8);
+ if (self.buffer.length > 0) {
+ self.parser.add(self.buffer);
+ }
+ if (self._proveReception(self._headers)) { self._payload(); }
+ return;
+ }
+
+ self.parser.add(data);
+ });
+
+};
+
+// http://www.whatwg.org/specs/web-apps/current-work/complete/network.html#opening-handshake
+WebSocket.prototype._proveReception = function(headers){
+ var self = this
+ , k1 = this.request.headers['sec-websocket-key1']
+ , k2 = this.request.headers['sec-websocket-key2'];
+
+ if (k1 && k2){
+ var md5 = crypto.createHash('md5');
+
+ [k1, k2].forEach(function(k){
+ var n = parseInt(k.replace(/[^\d]/g, '')),
+ spaces = k.replace(/[^ ]/g, '').length;
+
+ if (spaces === 0 || n % spaces !== 0){
+ self.listener.options.log('Invalid WebSocket key: "' + k + '". Dropping connection');
+ self._onClose();
+ return false;
+ }
+
+ n /= spaces;
+
+ md5.update(String.fromCharCode(
+ n >> 24 & 0xFF,
+ n >> 16 & 0xFF,
+ n >> 8 & 0xFF,
+ n & 0xFF));
+ });
+
+ md5.update(this.upgradeHead.toString('binary'));
+
+ try {
+ this.connection.write(md5.digest('binary'), 'binary');
+ } catch(e){
+ this._onClose();
+ }
+ }
+
+ return true;
+};
+
+WebSocket.prototype._write = function(message){
+ try {
+ this.connection.write('\u0000', 'binary');
+ this.connection.write(message, 'utf8');
+ this.connection.write('\uffff', 'binary');
+ } catch(e){
+ this._onClose();
+ }
+};
+
+WebSocket.httpUpgrade = true;
+
+function Parser(){
+ this.buffer = '';
+ this.i = 0;
+};
+
+Parser.prototype.__proto__ = EventEmitter.prototype;
+
+Parser.prototype.add = function(data){
+ this.buffer += data;
+ this.parse();
+};
+
+Parser.prototype.parse = function(){
+ for (var i = this.i, chr, l = this.buffer.length; i < l; i++){
+ chr = this.buffer[i];
+ if (i === 0){
+ if (chr != '\u0000')
+ this.error('Bad framing. Expected null byte as first frame');
+ else
+ continue;
+ }
+ if (chr == '\ufffd'){
+ this.emit('data', this.buffer.substr(1, this.buffer.length - 2));
+ this.buffer = this.buffer.substr(i + 1);
+ this.i = 0;
+ return this.parse();
+ }
+ }
+};
+
+Parser.prototype.error = function(reason){
+ this.buffer = '';
+ this.i = 0;
+ this.emit('error', reason);
+ return this;
+};
View
67 node-lib/squeenote/vendor/socket.io/lib/socket.io/transports/xhr-multipart.js
@@ -0,0 +1,67 @@
+var Client = require('../client')
+ , util = require(process.binding('natives').util ? 'util' : 'sys')
+ , qs = require('querystring');
+
+var Multipart = module.exports = function(){
+ Client.apply(this, arguments);
+};
+
+util.inherits(Multipart, Client);
+
+Multipart.prototype._onConnect = function(req, res){
+ var self = this, body = '', headers = {};
+ // https://developer.mozilla.org/En/HTTP_Access_Control
+ if (req.headers.origin && this._verifyOrigin(req.headers.origin)){
+ headers['Access-Control-Allow-Origin'] = '*';
+ headers['Access-Control-Allow-Credentials'] = 'true';
+ }
+ if (typeof req.headers['access-control-request-method'] !== 'undefined'){
+ // CORS preflight message
+ headers['Access-Control-Allow-Methods'] = req.headers['access-control-request-method'];
+ res.writeHead(200, headers);
+ res.write('ok');
+ res.end();
+ return;
+ }
+ switch (req.method){
+ case 'GET':
+ Client.prototype._onConnect.apply(this, [req, res]);
+ headers['Content-Type'] = 'multipart/x-mixed-replace;boundary="socketio"';
+ headers['Connection'] = 'keep-alive';
+ this.request.connection.addListener('end', function(){ self._onClose(); });
+ this.response.useChunkedEncodingByDefault = false;
+ this.response.shouldKeepAlive = true;
+ this.response.writeHead(200, headers);
+ this.response.write("--socketio\n");
+ if ('flush' in this.response) this.response.flush();
+ this._payload();
+ break;
+
+ case 'POST':
+ headers['Content-Type'] = 'text/plain';
+ req.addListener('data', function(message){
+ body += message.toString();
+ });
+ req.addListener('end', function(){
+ try {
+ var msg = qs.parse(body);
+ self._onMessage(msg.data);
+ } catch(e){
+ listener.options.log('xhr-multipart message handler error - ' + e.stack);
+ }
+ res.writeHead(200, headers);
+ res.write('ok');
+ res.end();
+ body = '';
+ });
+ break;
+ }
+};
+
+Multipart.prototype._write = function(message){
+ if (this._open){
+ this.response.write("Content-Type: text/plain" + (message.length === 1 && message.charCodeAt(0) === 6 ? "; charset=us-ascii" : "") + "\n\n");
+ this.response.write(message + "\n");
+ this.response.write("--socketio\n");
+ }
+};
View
80 node-lib/squeenote/vendor/socket.io/lib/socket.io/transports/xhr-polling.js
@@ -0,0 +1,80 @@
+var Client = require('../client')
+ , util = require(process.binding('natives').util ? 'util' : 'sys')
+ , qs = require('querystring');
+
+var Polling = module.exports = function(){
+ Client.apply(this, arguments);
+};
+
+util.inherits(Polling, Client);
+
+Polling.prototype.getOptions = function(){
+ return {
+ timeout: null, // no heartbeats
+ closeTimeout: 8000,
+ duration: 20000
+ };
+};
+
+Polling.prototype._onConnect = function(req, res){
+ var self = this, body = '';
+ switch (req.method){
+ case 'GET':
+ Client.prototype._onConnect.apply(this, [req, res]);
+ this._closeTimeout = setTimeout(function(){
+ self._write('');
+ }, this.options.duration);
+ this._payload();
+ break;
+
+ case 'POST':
+ req.addListener('data', function(message){
+ body += message;
+ });
+ req.addListener('end', function(){
+ var headers = {'Content-Type': 'text/plain'};
+ if (req.headers.origin){
+ if (self._verifyOrigin(req.headers.origin)){
+ headers['Access-Control-Allow-Origin'] = '*';
+ if (req.headers.cookie) headers['Access-Control-Allow-Credentials'] = 'true';
+ } else {
+ res.writeHead(401);
+ res.write('unauthorized');
+ res.end();
+ return;
+ }
+ }
+ try {
+ // optimization: just strip first 5 characters here?
+ var msg = qs.parse(body);
+ self._onMessage(msg.data);
+ } catch(e){
+ listener.options.log('xhr-polling message handler error - ' + e.stack);
+ }
+ res.writeHead(200, headers);
+ res.write('ok');
+ res.end();
+ });
+ break;
+ }
+};
+
+Polling.prototype._onClose = function(){
+ if (this._closeTimeout) clearTimeout(this._closeTimeout);
+ return Client.prototype._onClose.call(this);
+};
+
+Polling.prototype._write = function(message){
+ if (this._open){
+ var headers = {'Content-Type': 'text/plain; charset=UTF-8', 'Content-Length': Buffer.byteLength(message)};
+ // https://developer.mozilla.org/En/HTTP_Access_Control
+ if (this.request.headers.origin && this._verifyOrigin(this.request.headers.origin)){
+ headers['Access-Control-Allow-Origin'] = this.request.headers.origin;
+ if (this.request.headers.cookie) headers['Access-Control-Allow-Credentials'] = 'true';
+ }
+ this.response.writeHead(200, headers);
+ this.response.write(message);
+ this.response.end();
+ this._onClose();
+ }
+};
View
52 node-lib/squeenote/vendor/socket.io/lib/socket.io/utils.js
@@ -0,0 +1,52 @@
+exports.options = {
+ options: function(options, merge){
+ this.options = exports.merge(options || {}, merge || {});
+ }
+};
+
+exports.merge = function(source, merge){
+ for (var i in merge) source[i] = merge[i];
+ return source;
+};
+
+var frame = '~m~';
+
+function stringify(message){
+ if (Object.prototype.toString.call(message) == '[object Object]'){
+ return '~j~' + JSON.stringify(message);
+ } else {
+ return String(message);
+ }
+};
+
+exports.encode = function(messages){
+ var ret = '', message,
+ messages = Array.isArray(messages) ? messages : [messages];
+ for (var i = 0, l = messages.length; i < l; i++){
+ message = messages[i] === null || messages[i] === undefined ? '' : stringify(messages[i]);
+ ret += frame + message.length + frame + message;
+ }
+ return ret;
+};
+
+exports.decode = function(data){
+ var messages = [], number, n;
+ do {
+ if (data.substr(0, 3) !== frame) return messages;
+ data = data.substr(3);
+ number = '', n = '';
+ for (var i = 0, l = data.length; i < l; i++){
+ n = Number(data.substr(i, 1));
+ if (data.substr(i, 1) == n){
+ number += n;
+ } else {
+ data = data.substr(number.length + frame.length)
+ number = Number(number);
+ break;
+ }
+ }
+ messages.push(data.substr(0, number)); // here
+ data = data.substr(number);
+ } while(data !== '');
+ return messages;
+};
View
17 node-lib/squeenote/vendor/socket.io/package.json
@@ -0,0 +1,17 @@
+{ "name" : "socket.io"
+, "description" : "The cross-browser WebSocket"
+, "version" : "0.6.11"
+, "author" : "LearnBoost"
+, "licenses" :
+ [ { "type" : "MIT"
+ , "url" : "http://github.com/learnboost/Socket.IO-node/raw/master/README.md"
+ }
+ ]
+, "repository" :
+ { "type" : "git"
+ , "url" : "http://github.com/learnboost/Socket.IO-node.git"
+ }
+, "engine" : [ "node >=0.1.102" ]
+, "main" : "./index"
+, "scripts" : { "test" : "make test" }
+}
View
10 node-lib/squeenote/vendor/socket.io/socket.io.js
@@ -1,9 +1 @@
-require.paths.unshift(__dirname + '/vendor/js-oo/lib');
-require('oo');
-
-var sys = require('sys'),
- Listener = require('./socket.io/listener').Listener;
-
-this.listen = function(server, options){
- return new Listener(server, options);
-};
+module.exports = require('./lib/socket.io');
View
100 node-lib/squeenote/vendor/socket.io/socket.io/client.js
@@ -1,100 +0,0 @@
-var Options = require('./util/options').Options;
-
-this.Client = Class({
-
- include: [Options],
-
- options: {
- closeTimeout: 0
- },
-
- init: function(listener, req, res, options){
- this.listener = listener;
- this.setOptions(options);
- this.connections = 0;
- this.connected = false;
- this._onConnect(req, res);
- },
-
- send: function(message){
- if (!this.connected || !(this.connection.readyState == 'open' || this.connection.readyState == 'writeOnly')) return this._queue(message);
- this._write(JSON.stringify({messages: [message]}));
- return this;
- },
-
- broadcast: function(message){
- if (!('sessionId' in this)) return this;
- this.listener.broadcast(message, this.sessionId);
- return this;
- },
-
- _onMessage: function(data){
- try {
- var messages = JSON.parse(data);
- } catch(e){
- return this.listener.options.log('Bad message received from client ' + this.sessionId);
- }
- for (var i = 0, l = messages.length; i < l; i++){
- this.listener._onClientMessage(messages[i], this);
- }
- },
-
- _onConnect: function(req, res){
- var self = this;
- this.request = req;
- this.response = res;
- this.connection = this.request.connection;
- if (this._disconnectTimeout) clearTimeout(this._disconnectTimeout);
- },
-
- _payload: function(){
- var payload = [];
-
- this.connections++;
- this.connected = true;
-
- if (!this.handshaked){
- this._generateSessionId();
- payload.push(JSON.stringify({
- sessionid: this.sessionId
- }));
- this.handshaked = true;
- }
-
- payload = payload.concat(this._writeQueue || []);
- this._writeQueue = [];
-
- if (payload.length) this._write(JSON.stringify({messages: payload}));
- if (this.connections == 1) this.listener._onClientConnect(this);
- },
-
- _onClose: function(){
- var self = this;
- this.connected = false;
- this._disconnectTimeout = setTimeout(function(){
- self._onDisconnect();
- }, this.options.closeTimeout);
- },
-
- _onDisconnect: function(){
- if (!this.finalized){
- this._writeQueue = [];
- this.connected = false;
- this.finalized = true;
- if (this.handshaked) this.listener._onClientDisconnect(this);
- }
- },
-
- _queue: function(message){
- if (!('_writeQueue' in this)) this._writeQueue = [];
- this._writeQueue.push(message);
- return this;
- },
-
- _generateSessionId: function(){
- if (this.sessionId) return this.listener.options.log('This client already has a session id');
- this.sessionId = Math.random().toString().substr(2);
- return this;
- }
-
-});
View
123 node-lib/squeenote/vendor/socket.io/socket.io/listener.js
@@ -1,123 +0,0 @@
-var url = require('url'),
- sys = require('sys'),
- Options = require('./util/options').Options,
- Client = require('./client').Client,
-
-Transports = {};
-
-Listener = this.Listener = Class({
-
- include: [process.EventEmitter.prototype, Options],
-
- options: {
- origins: '*:*',
- resource: 'socket.io',
- transports: ['websocket', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling'],
- transportOptions: {},
- log: function(message){
- sys.log(message);
- }
- },
-
- init: function(server, options){
- var self = this;
- process.EventEmitter.call(this);
- this.server = server;
- this.setOptions(options);
- this.clients = [];
- this.clientsIndex = {};
-
- var listener = (this.server._events['request'] instanceof Array)
- ? this.server._events['request'][0]
- : this.server._events['request'];
- if (listener){
- this.server._events['request'] = function(req, res){
- if (self.check(req, res)) return;
- listener(req, res);
- };
- } else {
- throw new Error('Couldn\'t find the `request` event in the HTTP server.');
- }
-
- this.server.addListener('upgrade', function(req, socket, head){
- if (!self.check(req, socket, true)){
- socket.destroy();
- }
- });
-
- this.options.transports.forEach(function(t){
- if (!(t in Transports)){
- Transports[t] = require('./transports/' + t)[t];
- if (Transports[t].init) Transports[t].init(this);
- }
- }, this);
-
- this.options.log('socket.io ready - accepting connections');
- },
-
- broadcast: function(message, except){
- for (var i = 0, l = this.clients.length; i < l; i++){
- if (this.clients[i] && (!except || [].concat(except).indexOf(this.clients[i].sessionId) == -1)){
- this.clients[i].send(message);
- }
- }
- return this;
- },
-
- check: function(req, res, httpUpgrade){
- var path = url.parse(req.url).pathname, parts, cn;
- if (path.indexOf('/' + this.options.resource) === 0){
- parts = path.substr(1).split('/');
- if (parts[2]){
- cn = this._lookupClient(parts[2]);
- if (cn){
- cn._onConnect(req, res);
- } else {
- req.connection.end();
- sys.log('Couldnt find client with session id "' + parts[2] + '"');
- }
- } else {
- this._onConnection(parts[1], req, res, httpUpgrade);
- }
- return true;
- }
- return false;
- },
-
- _lookupClient: function(sid){
- return this.clientsIndex[sid];
- },
-
- _onClientConnect: function(client){
- if (!(client instanceof Client) || !client.sessionId){
- return sys.log('Invalid client');
- }
- client.i = this.clients.length;
- this.clients.push(client);
- this.clientsIndex[client.sessionId] = client;
- sys.log('Client '+ client.sessionId +' connected');
- this.emit('clientConnect', client);
- },
-
- _onClientMessage: function(data, client){
- this.emit('clientMessage', data, client);
- },
-
- _onClientDisconnect: function(client){
- this.clientsIndex[client.sessionId] = null;
- this.clients[client.i] = null;
- sys.log('Client '+ client.sessionId +' disconnected');
- this.emit('clientDisconnect', client);
- },
-
- // new connections (no session id)
- _onConnection: function(transport, req, res, httpUpgrade){
- if (this.options.transports.indexOf(transport) === -1 || (httpUpgrade && !Transports[transport].httpUpgrade)){
- httpUpgrade ? res.destroy() : req.connection.destroy();
- return sys.log('Illegal transport "'+ transport +'"');
- }
- sys.log('Initializing client with transport "'+ transport +'"');
- new Transports[transport](this, req, res, this.options.transportOptions[transport]);
- }
-
-});
View
25 node-lib/squeenote/vendor/socket.io/socket.io/transports/flashsocket.js
@@ -1,25 +0,0 @@
-var websocket = require('./websocket').websocket,
- net = require('net'),
- listeners = [];
-
-this.flashsocket = websocket.extend({});
-this.flashsocket.httpUpgrade = true;
-this.flashsocket.init = function(listener){
- listeners.push(listener);
-};
-
-net.createServer(function(socket){
- socket.write('<?xml version="1.0"?>\n');
- socket.write('<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">\n');
- socket.write('<cross-domain-policy>\n');
-
- listeners.forEach(function(l){
- [].concat(l.options.origins).forEach(function(origin){
- var parts = origin.split(':');
- socket.write('<allow-access-from domain="' + parts[0] +