Added socket.io-java link

This commit is contained in:
Guillermo Rauch
2010-11-09 08:33:40 -03:00
parent 96c3119e41
commit 7e334a51bb

View File

@@ -77,7 +77,7 @@ socket.on('connection', function(client){
socket.on('connect', function(){ … })
socket.on('message', function(){ … })
socket.on('disconnect', function(){ … })
&lt;/script&gt; </pre><p class="note">If you won't leverage Node.JS to serve your files, make sure to call `io.setPath()` with the path to your client side </p></div><div class="section"><div class="title" id="transports">Supported transports</div><p>In order to provide realtime connectivity on every browser, Socket.IO selects the most capable transport at runtime, without it affecting the API. </p><ul><li>WebSocket</li><li>Adobe® Flash® Socket</li><li>AJAX long polling</li><li>AJAX multipart streaming</li><li>Forever Iframe</li><li>JSONP Polling</li></ul></div><div class="section"><div class="title">Supported browsers</div><div class="subtitle">Desktop</div><ul><li>Internet Explorer 5.5 - 8</li><li>Safari 3 - 5</li><li>Google Chrome 4 - 6</li><li>Firefox 3-4</li><li>Opera 10.61</li></ul><div class="subtitle">Mobile</div><ul><li>iPhone Safari</li><li>iPad Safari</li><li>Android WebKit</li><li>WebOs WebKit</li></ul></div><div class="section"><div class="title">In the wild</div><div class="subtitle">Applications</div><ul><li><a href="http://maprejuice.com/">MapRejuice</a></li><li><a href="http://inflatable-chum.no.de/">Inflatable Chum</a></li><li><a href="http://braintree.no.de/">Push Relay</a></li><li><a href="http://nodty.no.de/">Lost & Found</a></li><li><a href="http://speedo.no.de/">Speedo</a></li><li><a href="http://github.com/saikat/drawtogether">DrawTogether</a></li><li><a href="http://github.com/cramforce/streamie">Streamie</a></li><li><a href="http://github.com/mkilling/alfamegle">Alfamegle</a></li><li><a href="http://explorer-sox.no.de">GabberTalk</a><span>2010 Node KO winner</span></li><li><a href="http://starcraft2destroyedmymarrage.no.de/">Serrano</a><span>2010 Node KO winner</span></li><li><a href="http://github.com/arunjitsingh/socket-chat">Socket-Chat</a></li></ul><div class="subtitle">Games</div><ul><li><a href="http://swarmation.com">Swarmation</a><span>2010 Node KO winner</span></li><li><a href="http://demiox-boiko.no.de/">Gunpixel</a></li><li><a href="http://piston-hurricane.no.de/">Giant Robots</a><span>2010 Node KO winner</span></li><li><a href="http://virtual-design.no.de/">Massivetris</a></li><li><a href="http://fragnut.me/">Fragnut</a></li><li><a href="http://github.com/jacobthornton/space-tweet">Space Tweet</a></li><li><a href="http://github.com/gerad/lazeroids-node/">Lazeroids</a></li></ul><div class="subtitle">Frameworks / Components</div><ul><li><a href="http://github.com/substack/dnode">DNode</a></li><li><a href="http://github.com/bnoguchi/Socket.IO-connect">Socket.IO-connect</a></li><li><a href="http://github.com/saikat/socket-logger/">Socket-logger</a></li><li><a href="http://github.com/maccman/juggernaut">Juggernaut</a></li><li><a href="http://github.com/jamescarr/nodejs-amqp-example">AMPQ + Socket.IO</a></li></ul></div><div class="section"><div class="title">Server Implementations</div><p>Besides the official <a href="http://github.com/learnboost/socket.io-node">Node.JS server</a>, several implementations have been started for other languages / frameworks that are compatible with the <a href="http://github.com/learnboost/socket.io">Socket.IO client</a>: </p><ul><li><a href="http://github.com/madari/go-socket.io">Google GO</a></li><li><a href="http://github.com/markjeee/Socket.IO-rack">Rack</a></li></ul></div><div class="section"><div class="title">Resources</div><div class="subtitle">Articles</div><ul><li><a href="http://nodeknockout.posterous.com/countdown-to-knockout-post-9-websockets-every">Socket.IO and the history of the realtime web - Guillermo Rauch, Node Knockout Blog</a></li><li><a href="http://jeffkreeftmeijer.com/2010/things-i-learned-from-my-node.js-experiment/">Node.JS WebSocket experiment - Jeff Kreeftmeijer</a></li><li><a href="http://substack.net/posts/85e1bd/DNode-Asynchronous-Remote-Method-Invocation-for-Node-js-and-the-Browser">Asynchronous remote method invocation with DNode - James Halliday, SubStack blog</a></li></ul></div><div class="section"><div class="title">FAQ</div><div class="subtitle">Does Socket.IO support cross-domain connections?</div><p>Absolutely, on every browser!</p><div class="subtitle">Why Flash?</div><p>Flash is absolutely <b>not required</b>for Socket.IO to function. If Flash is available, it'll be leveraged, as it provides almost the same capabilities as WebSocket. If it's not, the best next transport will be chosen. </p><div class="subtitle">I want to host the Socket.IO client myself</div><p>If you're not relying on Node.JS serving Socket.IO clientside JavaScript files, make sure you call io.setPath right after including socket.io.js with the location of where you cloned the Socket.IO client repository: </p><pre class="prettyprint">&lt;script src=&quot;/the/path/to/socket.io/socket.io.js&quot;&gt;&lt;/script&gt;
&lt;/script&gt; </pre><p class="note">If you won't leverage Node.JS to serve your files, make sure to call `io.setPath()` with the path to your client side </p></div><div class="section"><div class="title" id="transports">Supported transports</div><p>In order to provide realtime connectivity on every browser, Socket.IO selects the most capable transport at runtime, without it affecting the API. </p><ul><li>WebSocket</li><li>Adobe® Flash® Socket</li><li>AJAX long polling</li><li>AJAX multipart streaming</li><li>Forever Iframe</li><li>JSONP Polling</li></ul></div><div class="section"><div class="title">Supported browsers</div><div class="subtitle">Desktop</div><ul><li>Internet Explorer 5.5 - 8</li><li>Safari 3 - 5</li><li>Google Chrome 4 - 6</li><li>Firefox 3-4</li><li>Opera 10.61</li></ul><div class="subtitle">Mobile</div><ul><li>iPhone Safari</li><li>iPad Safari</li><li>Android WebKit</li><li>WebOs WebKit</li></ul></div><div class="section"><div class="title">In the wild</div><div class="subtitle">Applications</div><ul><li><a href="http://maprejuice.com/">MapRejuice</a></li><li><a href="http://inflatable-chum.no.de/">Inflatable Chum</a></li><li><a href="http://braintree.no.de/">Push Relay</a></li><li><a href="http://nodty.no.de/">Lost & Found</a></li><li><a href="http://speedo.no.de/">Speedo</a></li><li><a href="http://github.com/saikat/drawtogether">DrawTogether</a></li><li><a href="http://github.com/cramforce/streamie">Streamie</a></li><li><a href="http://github.com/mkilling/alfamegle">Alfamegle</a></li><li><a href="http://explorer-sox.no.de">GabberTalk</a><span>2010 Node KO winner</span></li><li><a href="http://starcraft2destroyedmymarrage.no.de/">Serrano</a><span>2010 Node KO winner</span></li><li><a href="http://github.com/arunjitsingh/socket-chat">Socket-Chat</a></li></ul><div class="subtitle">Games</div><ul><li><a href="http://swarmation.com">Swarmation</a><span>2010 Node KO winner</span></li><li><a href="http://demiox-boiko.no.de/">Gunpixel</a></li><li><a href="http://piston-hurricane.no.de/">Giant Robots</a><span>2010 Node KO winner</span></li><li><a href="http://virtual-design.no.de/">Massivetris</a></li><li><a href="http://fragnut.me/">Fragnut</a></li><li><a href="http://github.com/jacobthornton/space-tweet">Space Tweet</a></li><li><a href="http://github.com/gerad/lazeroids-node/">Lazeroids</a></li></ul><div class="subtitle">Frameworks / Components</div><ul><li><a href="http://github.com/substack/dnode">DNode</a></li><li><a href="http://github.com/bnoguchi/Socket.IO-connect">Socket.IO-connect</a></li><li><a href="http://github.com/saikat/socket-logger/">Socket-logger</a></li><li><a href="http://github.com/maccman/juggernaut">Juggernaut</a></li><li><a href="http://github.com/jamescarr/nodejs-amqp-example">AMPQ + Socket.IO</a></li></ul></div><div class="section"><div class="title">Server Implementations</div><p>Besides the official <a href="http://github.com/learnboost/socket.io-node">Node.JS server</a>, several implementations have been started for other languages / frameworks that are compatible with the <a href="http://github.com/learnboost/socket.io">Socket.IO client</a>: </p><ul><li><a href="http://code.google.com/p/socketio-java/">Java</a></li><li><a href="http://github.com/madari/go-socket.io">Google GO</a></li><li><a href="http://github.com/markjeee/Socket.IO-rack">Rack</a></li></ul></div><div class="section"><div class="title">Resources</div><div class="subtitle">Articles</div><ul><li><a href="http://nodeknockout.posterous.com/countdown-to-knockout-post-9-websockets-every">Socket.IO and the history of the realtime web - Guillermo Rauch, Node Knockout Blog</a></li><li><a href="http://jeffkreeftmeijer.com/2010/things-i-learned-from-my-node.js-experiment/">Node.JS WebSocket experiment - Jeff Kreeftmeijer</a></li><li><a href="http://substack.net/posts/85e1bd/DNode-Asynchronous-Remote-Method-Invocation-for-Node-js-and-the-Browser">Asynchronous remote method invocation with DNode - James Halliday, SubStack blog</a></li></ul></div><div class="section"><div class="title">FAQ</div><div class="subtitle">Does Socket.IO support cross-domain connections?</div><p>Absolutely, on every browser!</p><div class="subtitle">Why Flash?</div><p>Flash is absolutely <b>not required</b>for Socket.IO to function. If Flash is available, it'll be leveraged, as it provides almost the same capabilities as WebSocket. If it's not, the best next transport will be chosen. </p><div class="subtitle">I want to host the Socket.IO client myself</div><p>If you're not relying on Node.JS serving Socket.IO clientside JavaScript files, make sure you call io.setPath right after including socket.io.js with the location of where you cloned the Socket.IO client repository: </p><pre class="prettyprint">&lt;script src=&quot;/the/path/to/socket.io/socket.io.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;io.setPath(&#x27;/the/path/to/socket.io&#x27;)&lt;/script&gt; </pre><p>This is required in order for Socket.IO to find the .swf file required for Flash WebSocket.</p><div class="subtitle">Why not just call it `WebSocket` if the actual WebSocket is not present and mimick its API?</div><p>Socket.IO does more than WebSocket, even if WebSocket is selected as the transport and the user is browsing your website with an ultra modern browser. Certain features like heartbeats, timeouts and disconnection support are vital to realtime applications but are not provided by the WebSocket API out of the box. </p><p>This is akin to jQuery's decision of creating a feature-rich and simple $.ajax API as opposed to normalizing XMLHttpRequest.</p><p>Creating our own namespace io.Socket helps also avoid confusion and also makes it naturally extensible. You can add your own shortcut methods and alter the prototype without altering the original standard API. </p><div class="subtitle">Can I use Socket.IO with express / connect ?</div><p>Sure! Socket.IO only needs access to the http.Server instance of Node. Since all frameworks build on top of that API, Socket.IO is compatible with any framework out of the box. </p><p>This is an example of express and Socket.IO:</p><pre class="prettyprint">var app = express.createServer();
app.get('/', function(req, res){
res.send('Hello World');