Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit edaca150b816da49ffa2e8e7e39813471ea63254 @dannycoates dannycoates committed Jul 17, 2010
Showing with 46,240 additions and 0 deletions.
  1. BIN bin/._ni.js
  2. BIN bin/._t.js
  3. BIN bin/._test.html
  4. +89 −0 bin/debug-agent.js
  5. +219 −0 bin/ws.js
  6. +524 −0 front-end/AbstractTimelinePanel.js
  7. +259 −0 front-end/ApplicationCacheItemsView.js
  8. +70 −0 front-end/AuditCategories.js
  9. +284 −0 front-end/AuditLauncherView.js
  10. +106 −0 front-end/AuditResultView.js
  11. +1,031 −0 front-end/AuditRules.js
  12. +495 −0 front-end/AuditsPanel.js
  13. +264 −0 front-end/BottomUpProfileDataGridTree.js
  14. +216 −0 front-end/BreakpointManager.js
  15. +153 −0 front-end/BreakpointsSidebarPane.js
  16. +102 −0 front-end/CSSCompletions.js
  17. +111 −0 front-end/CSSStyleModel.js
  18. +174 −0 front-end/CallStackSidebarPane.js
  19. +56 −0 front-end/Callback.js
  20. +80 −0 front-end/ChangesView.js
  21. +63 −0 front-end/Checkbox.js
  22. +661 −0 front-end/Color.js
  23. +86 −0 front-end/ConsolePanel.js
  24. +1,090 −0 front-end/ConsoleView.js
  25. +83 −0 front-end/ContextMenu.js
  26. +303 −0 front-end/CookieItemsView.js
  27. +708 −0 front-end/DOMAgent.js
  28. +78 −0 front-end/DOMStorage.js
  29. +157 −0 front-end/DOMStorageItemsView.js
  30. +79 −0 front-end/DOMSyntaxHighlighter.js
  31. +1,282 −0 front-end/DataGrid.js
  32. +103 −0 front-end/Database.js
  33. +196 −0 front-end/DatabaseQueryView.js
  34. +90 −0 front-end/DatabaseTableView.js
  35. +359 −0 front-end/Drawer.js
  36. +1,153 −0 front-end/ElementsPanel.js
  37. +1,416 −0 front-end/ElementsTreeOutline.js
  38. +241 −0 front-end/EventListenersSidebarPane.js
  39. +107 −0 front-end/FontView.js
  40. +135 −0 front-end/HAREntry.js
  41. +102 −0 front-end/HelpScreen.js
  42. +83 −0 front-end/ImageView.js
  43. BIN front-end/Images/applicationCache.png
  44. BIN front-end/Images/auditsIcon.png
  45. BIN front-end/Images/back.png
  46. BIN front-end/Images/breakpointBorder.png
  47. BIN front-end/Images/breakpointConditionalBorder.png
  48. BIN front-end/Images/breakpointConditionalCounterBorder.png
  49. BIN front-end/Images/breakpointCounterBorder.png
  50. BIN front-end/Images/breakpointsActivateButtonGlyph.png
  51. BIN front-end/Images/breakpointsDeactivateButtonGlyph.png
  52. BIN front-end/Images/checker.png
  53. BIN front-end/Images/clearConsoleButtonGlyph.png
  54. BIN front-end/Images/closeButtons.png
  55. BIN front-end/Images/consoleButtonGlyph.png
  56. BIN front-end/Images/consoleIcon.png
  57. BIN front-end/Images/cookie.png
  58. BIN front-end/Images/database.png
  59. BIN front-end/Images/databaseTable.png
  60. BIN front-end/Images/debuggerContinue.png
  61. BIN front-end/Images/debuggerPause.png
  62. BIN front-end/Images/debuggerStepInto.png
  63. BIN front-end/Images/debuggerStepOut.png
  64. BIN front-end/Images/debuggerStepOver.png
  65. BIN front-end/Images/disclosureTriangleSmallDown.png
  66. BIN front-end/Images/disclosureTriangleSmallDownBlack.png
  67. BIN front-end/Images/disclosureTriangleSmallDownWhite.png
  68. BIN front-end/Images/disclosureTriangleSmallRight.png
  69. BIN front-end/Images/disclosureTriangleSmallRightBlack.png
  70. BIN front-end/Images/disclosureTriangleSmallRightDown.png
  71. BIN front-end/Images/disclosureTriangleSmallRightDownBlack.png
  72. BIN front-end/Images/disclosureTriangleSmallRightDownWhite.png
  73. BIN front-end/Images/disclosureTriangleSmallRightWhite.png
  74. BIN front-end/Images/dockButtonGlyph.png
  75. BIN front-end/Images/elementsIcon.png
  76. BIN front-end/Images/enableOutlineButtonGlyph.png
  77. BIN front-end/Images/enableSolidButtonGlyph.png
  78. BIN front-end/Images/errorIcon.png
  79. BIN front-end/Images/errorMediumIcon.png
  80. BIN front-end/Images/errorRedDot.png
  81. BIN front-end/Images/excludeButtonGlyph.png
  82. BIN front-end/Images/focusButtonGlyph.png
  83. BIN front-end/Images/forward.png
  84. BIN front-end/Images/gearButtonGlyph.png
  85. BIN front-end/Images/glossyHeader.png
  86. BIN front-end/Images/glossyHeaderPressed.png
  87. BIN front-end/Images/glossyHeaderSelected.png
  88. BIN front-end/Images/glossyHeaderSelectedPressed.png
  89. BIN front-end/Images/goArrow.png
  90. BIN front-end/Images/graphLabelCalloutLeft.png
  91. BIN front-end/Images/graphLabelCalloutRight.png
  92. BIN front-end/Images/grayConnectorPoint.png
  93. BIN front-end/Images/largerResourcesButtonGlyph.png
  94. BIN front-end/Images/localStorage.png
  95. BIN front-end/Images/nodeSearchButtonGlyph.png
  96. BIN front-end/Images/paneBottomGrow.png
  97. BIN front-end/Images/paneBottomGrowActive.png
  98. BIN front-end/Images/paneGrowHandleLine.png
  99. BIN front-end/Images/paneSettingsButtons.png
  100. BIN front-end/Images/pauseOnExceptionButtonGlyph.png
  101. BIN front-end/Images/percentButtonGlyph.png
  102. BIN front-end/Images/popoverArrows.png
  103. BIN front-end/Images/popoverBackground.png
  104. BIN front-end/Images/profileGroupIcon.png
  105. BIN front-end/Images/profileIcon.png
  106. BIN front-end/Images/profileSmallIcon.png
  107. BIN front-end/Images/profilesIcon.png
  108. BIN front-end/Images/profilesSilhouette.png
  109. BIN front-end/Images/programCounterBorder.png
  110. BIN front-end/Images/radioDot.png
  111. BIN front-end/Images/recordButtonGlyph.png
  112. BIN front-end/Images/recordToggledButtonGlyph.png
  113. BIN front-end/Images/reloadButtonGlyph.png
  114. BIN front-end/Images/resourceCSSIcon.png
  115. BIN front-end/Images/resourceDocumentIcon.png
  116. BIN front-end/Images/resourceDocumentIconSmall.png
  117. BIN front-end/Images/resourceJSIcon.png
  118. BIN front-end/Images/resourcePlainIcon.png
  119. BIN front-end/Images/resourcePlainIconSmall.png
  120. BIN front-end/Images/resourcesIcon.png
  121. BIN front-end/Images/resourcesSilhouette.png
  122. BIN front-end/Images/resourcesSizeGraphIcon.png
  123. BIN front-end/Images/resourcesTimeGraphIcon.png
  124. BIN front-end/Images/scriptsIcon.png
  125. BIN front-end/Images/scriptsSilhouette.png
  126. BIN front-end/Images/searchSmallBlue.png
  127. BIN front-end/Images/searchSmallBrightBlue.png
  128. BIN front-end/Images/searchSmallGray.png
  129. BIN front-end/Images/searchSmallWhite.png
  130. BIN front-end/Images/segment.png
  131. BIN front-end/Images/segmentEnd.png
  132. BIN front-end/Images/segmentHover.png
  133. BIN front-end/Images/segmentHoverEnd.png
  134. BIN front-end/Images/segmentSelected.png
  135. BIN front-end/Images/segmentSelectedEnd.png
  136. BIN front-end/Images/sessionStorage.png
  137. BIN front-end/Images/spinner.gif
  138. BIN front-end/Images/splitviewDimple.png
  139. BIN front-end/Images/splitviewDividerBackground.png
  140. BIN front-end/Images/statusbarBackground.png
  141. BIN front-end/Images/statusbarBottomBackground.png
  142. BIN front-end/Images/statusbarButtons.png
  143. BIN front-end/Images/statusbarMenuButton.png
  144. BIN front-end/Images/statusbarMenuButtonSelected.png
  145. BIN front-end/Images/statusbarResizerHorizontal.png
  146. BIN front-end/Images/statusbarResizerVertical.png
  147. BIN front-end/Images/storageIcon.png
  148. BIN front-end/Images/successGreenDot.png
  149. BIN front-end/Images/thumbActiveHoriz.png
  150. BIN front-end/Images/thumbActiveVert.png
  151. BIN front-end/Images/thumbHoriz.png
  152. BIN front-end/Images/thumbHoverHoriz.png
  153. BIN front-end/Images/thumbHoverVert.png
  154. BIN front-end/Images/thumbVert.png
  155. BIN front-end/Images/timelineBarBlue.png
  156. BIN front-end/Images/timelineBarGray.png
  157. BIN front-end/Images/timelineBarGreen.png
  158. BIN front-end/Images/timelineBarOrange.png
  159. BIN front-end/Images/timelineBarPurple.png
  160. BIN front-end/Images/timelineBarRed.png
  161. BIN front-end/Images/timelineBarYellow.png
  162. BIN front-end/Images/timelineCheckmarks.png
  163. BIN front-end/Images/timelineDots.png
  164. BIN front-end/Images/timelineHollowPillBlue.png
  165. BIN front-end/Images/timelineHollowPillGray.png
  166. BIN front-end/Images/timelineHollowPillGreen.png
  167. BIN front-end/Images/timelineHollowPillOrange.png
  168. BIN front-end/Images/timelineHollowPillPurple.png
  169. BIN front-end/Images/timelineHollowPillRed.png
  170. BIN front-end/Images/timelineHollowPillYellow.png
  171. BIN front-end/Images/timelineIcon.png
  172. BIN front-end/Images/timelinePillBlue.png
  173. BIN front-end/Images/timelinePillGray.png
  174. BIN front-end/Images/timelinePillGreen.png
  175. BIN front-end/Images/timelinePillOrange.png
  176. BIN front-end/Images/timelinePillPurple.png
  177. BIN front-end/Images/timelinePillRed.png
  178. BIN front-end/Images/timelinePillYellow.png
  179. BIN front-end/Images/toolbarItemSelected.png
  180. BIN front-end/Images/trackHoriz.png
  181. BIN front-end/Images/trackVert.png
  182. BIN front-end/Images/treeDownTriangleBlack.png
  183. BIN front-end/Images/treeDownTriangleWhite.png
  184. BIN front-end/Images/treeRightTriangleBlack.png
  185. BIN front-end/Images/treeRightTriangleWhite.png
  186. BIN front-end/Images/treeUpTriangleBlack.png
  187. BIN front-end/Images/treeUpTriangleWhite.png
  188. BIN front-end/Images/undockButtonGlyph.png
  189. BIN front-end/Images/userInputIcon.png
  190. BIN front-end/Images/userInputPreviousIcon.png
  191. BIN front-end/Images/userInputResultIcon.png
  192. BIN front-end/Images/warningIcon.png
  193. BIN front-end/Images/warningMediumIcon.png
  194. BIN front-end/Images/warningOrangeDot.png
  195. BIN front-end/Images/warningsErrors.png
  196. BIN front-end/Images/whiteConnectorPoint.png
  197. +345 −0 front-end/InjectedFakeWorker.js
  198. +775 −0 front-end/InjectedScript.js
  199. +87 −0 front-end/InjectedScriptAccess.js
  200. +386 −0 front-end/InspectorBackendStub.js
  201. +276 −0 front-end/InspectorController.js
  202. +135 −0 front-end/InspectorFrontendHostStub.js
  203. +169 −0 front-end/KeyboardShortcut.js
  204. +217 −0 front-end/MetricsSidebarPane.js
  205. +90 −0 front-end/Object.js
  206. +267 −0 front-end/ObjectPropertiesSection.js
  207. +70 −0 front-end/ObjectProxy.js
  208. +442 −0 front-end/Panel.js
  209. +102 −0 front-end/PanelEnablerView.js
  210. +106 −0 front-end/Placard.js
  211. +245 −0 front-end/Popover.js
  212. +408 −0 front-end/ProfileDataGridTree.js
  213. +623 −0 front-end/ProfileView.js
  214. +631 −0 front-end/ProfilesPanel.js
  215. +43 −0 front-end/PropertiesSection.js
  216. +65 −0 front-end/PropertiesSidebarPane.js
  217. +644 −0 front-end/Resource.js
  218. +65 −0 front-end/ResourceCategory.js
  219. +338 −0 front-end/ResourceView.js
  220. +1,404 −0 front-end/ResourcesPanel.js
  221. +148 −0 front-end/ScopeChainSidebarPane.js
  222. +72 −0 front-end/Script.js
  223. +137 −0 front-end/ScriptView.js
  224. +1,039 −0 front-end/ScriptsPanel.js
  225. +155 −0 front-end/Section.js
  226. +122 −0 front-end/Settings.js
  227. +159 −0 front-end/ShortcutsHelp.js
  228. +133 −0 front-end/SidebarPane.js
  229. +201 −0 front-end/SidebarTreeElement.js
  230. +1,473 −0 front-end/SourceCSSTokenizer.js
  231. +318 −0 front-end/SourceCSSTokenizer.re2js
  232. +718 −0 front-end/SourceFrame.js
  233. +687 −0 front-end/SourceHTMLTokenizer.js
  234. +303 −0 front-end/SourceHTMLTokenizer.re2js
  235. +2,417 −0 front-end/SourceJavaScriptTokenizer.js
  236. +178 −0 front-end/SourceJavaScriptTokenizer.re2js
  237. +102 −0 front-end/SourceTokenizer.js
  238. +313 −0 front-end/SourceView.js
  239. +148 −0 front-end/StatusBarButton.js
  240. +620 −0 front-end/StoragePanel.js
  241. +1,642 −0 front-end/StylesSidebarPane.js
  242. +363 −0 front-end/SummaryBar.js
  243. +81 −0 front-end/TabbedPane.js
  244. +81 −0 front-end/TestController.js
  245. +132 −0 front-end/TextEditorHighlighter.js
  246. +312 −0 front-end/TextEditorModel.js
  247. +484 −0 front-end/TextPrompt.js
  248. +785 −0 front-end/TextViewer.js
  249. +73 −0 front-end/TimelineAgent.js
  250. +167 −0 front-end/TimelineGrid.js
  251. +600 −0 front-end/TimelineOverviewPane.js
  252. +1,133 −0 front-end/TimelinePanel.js
  253. +121 −0 front-end/TopDownProfileDataGridTree.js
  254. +74 −0 front-end/View.js
  255. +281 −0 front-end/WatchExpressionsSidebarPane.js
  256. +262 −0 front-end/WebKit.qrc
  257. +73 −0 front-end/WelcomeView.js
  258. +114 −0 front-end/WorkersSidebarPane.js
  259. +281 −0 front-end/audits.css
  260. +5 −0 front-end/background.html
  261. +153 −0 front-end/helpScreen.css
  262. +4,184 −0 front-end/inspector.css
  263. +154 −0 front-end/inspector.html
  264. +2,125 −0 front-end/inspector.js
  265. +111 −0 front-end/inspectorSyntaxHighlight.css
  266. +14 −0 front-end/manifest.json
  267. +200 −0 front-end/popover.css
  268. +163 −0 front-end/textViewer.css
  269. +879 −0 front-end/treeoutline.js
  270. +999 −0 front-end/utilities.js
  271. +10 −0 test/hello.js
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,89 @@
+#!/usr/bin/env node
+
+var net = require('net'),
+ sys = require('sys'),
+ ws = require('./ws');
+
+///////////////////////////////////////////////////////////
+// Browser side
+
+var socket = null;
+var seq = 0;
+
+ws.createServer(function (websocket) {
+ socket = websocket;
+ websocket.addListener('data', function (data) {
+ // handle incoming data
+ request(data);
+ }).addListener('close', function () {
+ socket = null;
+ //TODO: dis/reconnect to node
+ });
+}).listen(8080); //TODO: make port configurable
+
+//////////////////////////////////////////////////////////
+// Node side
+
+var buffer = '';
+var current = false;
+
+function request(data) {
+ var message = 'Content-Length: ' + data.length + '\r\n\r\n' + data;
+ conn.write(message);
+}
+
+function makeMessage() {
+ return {
+ headersDone: false,
+ headers: null,
+ contentLength: 0
+ };
+}
+
+function parseBody() {
+ if (buffer.length >= current.contentLength) {
+ current.body = buffer.slice(0, current.contentLength);
+ buffer = buffer.slice(current.contentLength);
+ if (current.body.length > 0 && socket) {
+ socket.write(current.body);
+ }
+ current = false;
+ }
+}
+
+function parse() {
+ if (current && current.headersDone) {
+ parseBody();
+ return;
+ }
+
+ if (!current) current = makeMessage();
+
+ var offset = buffer.indexOf('\r\n\r\n');
+ if (offset > 0) {
+ current.headersDone = true;
+ current.headers = buffer.substr(0, offset+4);
+ var m = /Content-Length: (\d+)/.exec(current.headers);
+ if (m[1]) {
+ current.contentLength = parseInt(m[1], 10);
+ }
+ else {
+ sys.debug('no Content-Length');
+ }
+ buffer = buffer.slice(offset+4);
+ parse();
+ }
+}
+
+var conn = net.createConnection(5858); //TODO: make port configurable
+
+conn.setEncoding('ascii');
+
+conn.on('data', function(data) {
+ buffer += data;
+ parse();
+});
+
+conn.on('end', function() {
+ process.exit();
+});
219 bin/ws.js
@@ -0,0 +1,219 @@
+// Github: http://github.com/ncr/node.ws.js
+// Compatible with node v0.1.91
+// Author: Jacek Becela
+// Contributors:
+// Michael Stillwell http://github.com/ithinkihaveacat
+// Nick Chapman http://github.com/nchapman
+// Dmitriy Shalashov http://github.com/skaurus
+// Johan Dahlberg
+// Andreas Kompanez
+// License: MIT
+// Based on: http://github.com/Guille/node.websocket.js
+
+function nano(template, data) {
+ return template.replace(/\{([\w\.]*)}/g, function (str, key) {
+ var keys = key.split("."), value = data[keys.shift()];
+ keys.forEach(function (key) { value = value[key] });
+ return value;
+ });
+}
+
+function pack(num) {
+ var result = '';
+ result += String.fromCharCode(num >> 24 & 0xFF);
+ result += String.fromCharCode(num >> 16 & 0xFF);
+ result += String.fromCharCode(num >> 8 & 0xFF);
+ result += String.fromCharCode(num & 0xFF);
+ return result;
+}
+
+var sys = require("sys"),
+ net = require("net"),
+ crypto = require("crypto"),
+ requiredHeaders = {
+ 'get': /^GET (\/[^\s]*)/,
+ 'upgrade': /^WebSocket$/,
+ 'connection': /^Upgrade$/,
+ 'host': /^(.+)$/,
+ 'origin': /^(.+)$/,
+ },
+ handshakeTemplate75 = [
+ 'HTTP/1.1 101 Web Socket Protocol Handshake',
+ 'Upgrade: WebSocket',
+ 'Connection: Upgrade',
+ 'WebSocket-Origin: {origin}',
+ 'WebSocket-Location: ws://{host}{resource}',
+ '',
+ ''
+ ].join("\r\n"),
+ handshakeTemplate76 = [
+ 'HTTP/1.1 101 WebSocket Protocol Handshake', // note a diff here
+ 'Upgrade: WebSocket',
+ 'Connection: Upgrade',
+ 'Sec-WebSocket-Origin: {origin}',
+ 'Sec-WebSocket-Location: ws://{host}{resource}',
+ '',
+ '{data}'
+ ].join("\r\n"),
+ flashPolicy = '<cross-domain-policy><allow-access-from domain="*" to-ports="*" /></cross-domain-policy>';
+
+
+exports.createServer = function (websocketListener, options) {
+ if (!options) options = {};
+ if (!options.flashPolicy) options.flashPolicy = flashPolicy;
+
+ return net.createServer(function (socket) {
+ socket.setTimeout(0);
+ socket.setNoDelay(true);
+ socket.setKeepAlive(true, 0);
+
+ var emitter = new process.EventEmitter(),
+ handshaked = false,
+ buffer = "";
+
+ function handle(data) {
+ buffer += data;
+
+ var chunks = buffer.split("\ufffd"),
+ count = chunks.length - 1; // last is "" or a partial packet
+
+ for(var i = 0; i < count; i++) {
+ var chunk = chunks[i];
+ if(chunk[0] == "\u0000") {
+ emitter.emit("data", chunk.slice(1));
+ } else {
+ socket.end();
+ return;
+ }
+ }
+
+ buffer = chunks[count];
+ }
+
+ function handshake(data) {
+ var _headers = data.split("\r\n");
+
+ if ( /<policy-file-request.*>/.exec(_headers[0]) ) {
+ socket.write( options.flashPolicy );
+ socket.end();
+ return;
+ }
+
+ // go to more convenient hash form
+ var headers = {}, upgradeHead, len = _headers.length;
+ if ( _headers[0].match(/^GET /) ) {
+ headers["get"] = _headers[0];
+ } else {
+ socket.end();
+ return;
+ }
+ if ( _headers[ _headers.length - 1 ] ) {
+ upgradeHead = _headers[ _headers.length - 1 ];
+ len--;
+ }
+ while (--len) { // _headers[0] will be skipped
+ var header = _headers[len];
+ if (!header) continue;
+
+ var split = header.split(": ", 2); // second parameter actually seems to not work in node
+ headers[ split[0].toLowerCase() ] = split[1];
+ }
+
+ // check if we have all needed headers and fetch data from them
+ var data = {}, match;
+ for (var header in requiredHeaders) {
+ // regexp actual header value
+ if ( match = requiredHeaders[ header ].exec( headers[header] ) ) {
+ data[header] = match;
+ } else {
+ socket.end();
+ return;
+ }
+ }
+
+ // draft auto-sensing
+ if ( headers["sec-websocket-key1"] && headers["sec-websocket-key2"] && upgradeHead ) { // 76
+ var strkey1 = headers["sec-websocket-key1"]
+ , strkey2 = headers["sec-websocket-key2"]
+
+ , numkey1 = parseInt(strkey1.replace(/[^\d]/g, ""), 10)
+ , numkey2 = parseInt(strkey2.replace(/[^\d]/g, ""), 10)
+
+ , spaces1 = strkey1.replace(/[^\ ]/g, "").length
+ , spaces2 = strkey2.replace(/[^\ ]/g, "").length;
+
+ if (spaces1 == 0 || spaces2 == 0 || numkey1 % spaces1 != 0 || numkey2 % spaces2 != 0) {
+ socket.end();
+ return;
+ }
+
+ var hash = crypto.createHash("md5")
+ , key1 = pack(parseInt(numkey1/spaces1))
+ , key2 = pack(parseInt(numkey2/spaces2));
+
+ hash.update(key1);
+ hash.update(key2);
+ hash.update(upgradeHead);
+
+ socket.write(nano(handshakeTemplate76, {
+ resource: data.get[1],
+ host: data.host[1],
+ origin: data.origin[1],
+ data: hash.digest("binary"),
+ }), "binary");
+
+ } else { // 75
+ socket.write(nano(handshakeTemplate75, {
+ resource: data.get[1],
+ host: data.host[1],
+ origin: data.origin[1],
+ }));
+
+ }
+
+ handshaked = true;
+ emitter.emit("connect", data.get[1]);
+ }
+
+ socket.addListener("data", function (data) {
+ if(handshaked) {
+ handle(data.toString("utf8"));
+ } else {
+ handshake(data.toString("binary")); // because of draft76 handshakes
+ }
+ }).addListener("end", function () {
+ socket.end();
+ }).addListener("close", function () {
+ if (handshaked) { // don't emit close from policy-requests
+ emitter.emit("close");
+ }
+ }).addListener("error", function (exception) {
+ if (emitter.listeners("error").length > 0) {
+ emitter.emit("error", exception);
+ } else {
+ throw exception;
+ }
+ });
+
+ emitter.remoteAddress = socket.remoteAddress;
+
+ emitter.write = function (data) {
+ try {
+ socket.write('\u0000', 'binary');
+ socket.write(data, 'utf8');
+ socket.write('\uffff', 'binary');
+ } catch(e) {
+ // Socket not open for writing,
+ // should get "close" event just before.
+ socket.end();
+ }
+ }
+
+ emitter.end = function () {
+ socket.end();
+ }
+
+ websocketListener(emitter); // emits: "connect", "data", "close", provides: write(data), end()
+ });
+}
+
Oops, something went wrong.

0 comments on commit edaca15

Please sign in to comment.