FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

page progress · binaryjs/binaryjs.github.com@9429ac5 · GitHub

Repository navigation

Commit 9429ac5

Browse files
committed
page progress
1 parent 97d9d0e commit 9429ac5

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

‎index.html‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,24 @@ <h1>BinaryJS</h1>
2424
</header>
2525

2626
<section>
27-
27+
<h3>Show me the API</h3>
28+
<p>BinaryJS allows multiple streams over a single realtime websocket connection. Either the client or server can create a stream and both client and server can write to it once created.</p>
29+
<pre><code>
30+
var server = BinaryServer({port: 9000});
31+
server.on('connection', function(client){
32+
client.on('stream', function(stream){
33+
var w = fs.createWriteStream(stream.id+'.txt');
34+
stream.pipe(w);
35+
});
36+
});
37+
</code></pre>
38+
2839
<h3>Binary data for the web is here</h3>
2940
<p>A year ago if someone asked you "how do I stream binary data / audio / video / files to Javascript", the answer was "Flash" or "no" (or "Java applets") </p>
3041
<p>But as of Chrome 15+, Firefox 11+, Internet Explorer 10, and Safari nightly builds, that is no longer true.<p>
3142
<p>BinaryJS is a light but comprehensive framework utilizing websockets to:</p>
3243
<ul>
33-
<li>Send, stream, or pipe binary data between web clients and Node.js</li>
44+
<li>Send, stream, or pipe binary data between web javascript and Node.js</li>
3445
<li>Data is never stringified. Everything is only ever binary</li>
3546
<li>BinaryPack serialization is included and fully JSON compatible</li>
3647
<li>Multiplexed websocket streams. A client and server can send any number of streams to each other</li>
@@ -45,12 +56,11 @@ <h3>What can you do with this?</h3>
4556
<li>Streaming FLAC into HTML5 WebAudio api</li>
4657
<li>Progressive image loading (for retina displays and high-res photorgraphy)</li>
4758
<li>Multiplayer video games without expensive stringifying</li>
59+
<li>Streaming file uploads (see example)</li>
4860
<li>Live HTML &lt;video&gt; streaming</li>
4961
<li>PJAX with no http requests. Not even for image assets.</li>
5062
<li>Video / audio chat over websockets</li>
5163
</ul>
52-
<h3>Show me the API</h3>
53-
<p>The BinaryJS allows multiple streams over a single socket connection. Either the server and create a stream and both client and server can write to it once created.</p>
5464

5565
<!--
5666
<h3>Welcome to GitHub Pages.</h3>

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL