You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p><strong>BinaryJS is bidrectional realtime binary data with binary websockets</strong></p>
29
30
<p>A year ago if someone asked you "how do I stream binary data / audio / video / files to Javascript?" the answer would have been "Flash" or "no" (or "Java applets")</p>
30
31
<p>But as of Chrome 15+, Firefox 11+, Internet Explorer 10, and Safari nightly builds, that is no longer true.<p>
31
32
<p>BinaryJS is a lightweight framework that utilizes websockets to send, stream, and pipe binary data bidirectionally between browser javascript and Node.js.</p>
@@ -57,9 +58,11 @@ <h3>Show me the API</h3>
57
58
stream.end();
58
59
});
59
60
</code></pre>
60
-
61
61
<p>
62
-
<ahref="">View the "Hello world" example</a>
62
+
<ahref="https://github.com/binaryjs/binaryjs/blob/master/doc/api.md">View the API reference</a>
63
+
</p>
64
+
<p>
65
+
<ahref="https://github.com/binaryjs/binaryjs/tree/master/examples/helloworld">View the "Hello world" example</a>
63
66
</p>
64
67
<p>
65
68
<ahref="/examples.html">See more examples</a>
@@ -69,15 +72,15 @@ <h3>What can you do with this?</h3>
69
72
<p>You have just as much flexibility as a full TCP socket between client and server</p>
70
73
<p>Here are some ideas that are now possible (beta-testers are already working on some!):</p>
71
74
<ul>
75
+
<li>Realtime multiplayer video games without expensive stringifying</li>
72
76
<li>Streaming FLAC into HTML5 WebAudio api</li>
73
77
<li>Progressive image loading (for retina displays and high-res photorgraphy)</li>
74
-
<li>Multiplayer video games without expensive stringifying</li>
<li>PJAX with no HTTP requests. Not even for image assets</li>
78
81
<li>Video / audio chat over websockets</li>
79
82
</ul>
80
-
<h3>Technical details</h3>
83
+
<h3>Additional details</h3>
81
84
<p>BinaryJS employs `BinaryPack` a modified version of the MessagePack protocol. The Node.js server uses a modified version of the `ws` library enhanced to pass through the status of the socket buffer so adherence to Node.js Stream API is possible.</p>
82
85
<p>Both the server and the client can write or accept any arbitrary JSON type or structure – Objects, arrays, null, booleans, strings – and also binary data. Because BinaryPack is a binary protocol, the wire format has negligible serialization/deserialization overhead for large chunks of binary data. This also means binary data types such as Buffer in Node.js and Blob or ArrayBuffer in the client can be serialized and deserialized.</p>
83
86
<p>On the client, feature detection is employed to choose between using BlobBuilder, the Blob constructor, and ArrayBufferViews or ArrayBuffers themselves for assembling Blobs for transport.</p>
<script>!function(d,s,id){varjs,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script><br><small><ahref="http://ericzhang.com">I am unemployed</a> ‐ Theme by <ahref="https://github.com/orderedlist">orderedlist</a></small></p>
127
131
</footer>
128
132
</div>
129
133
<ahref="https://github.com/binaryjs/binaryjs"><imgstyle="position: fixed; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
0 commit comments