WebSockets

  • Revision slug: WebSockets
  • Revision title: WebSockets
  • Revision id: 802
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 13 words added, 2 words removed

Revision Content

{{ SeeCompatTable() }}

WebSockets is a technology that makes it possible to open an interactive communication session between the user's browser and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.

Documentation

Writing WebSocket client applications
A tutorial guide to writing WebSocket clients to run in the browser.
WebSockets reference
A reference to the client-side WebSocket API.
The WebSocket protocol
A reference to the WebSocket protocol.
Writing WebSocket servers
A guide to writing server-side code to handle the WebSocket protocol.

View All...

Tools


Related Topics

AJAXJavaScript

See also

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Version -76 support {{ obsolete_inline() }} {{ CompatUnknown() }} {{ CompatGeckoDesktop("2.0") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
Version IETF-07 support {{ CompatUnknown() }} {{ CompatGeckoDesktop("6.0") }} {{ property_prefix("-moz") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
Version IETF-08 support {{ CompatUnknown() }} {{ CompatGeckoDesktop("7.0") }} {{ property_prefix("-moz") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Version -76 support {{ obsolete_inline() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
Version IETF-07 support {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
Version IETF-08 support {{ CompatUnknown() }} {{ CompatGeckoMobile("7.0") }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

Gecko notes

WebSockets support in Firefox is continuing to track the evolving WebSocket specification. Firefox 6 implements version IETF-07 of the underlying protocol, while Firefox 7 implements version IETF-08. Firefox mobile received WebSocket support in Firefox mobile 7.0.

Note: Starting in Gecko 7.0 {{ geckoRelease("7.0") }}, the network.websocket.max-connections preference is used to determine the maximum number of WebSocket connections that can be open at a time. The default value is 200.
Warning: Among other things, a key reason WebSockets is currently disabled by default in Firefox 4 and 5 is the discovery of a security issue in the protocol's design. Using WebSockets in those versions of Firefox in a production environment is not recommended at this time. If you still wish to experiment with WebSockets, you may do so by opening about:config and setting the network.websocket.enabled preference to true. You will also need to set the network.websocket.override-security-block preference to true in order to allow initializing a WebSocket connection.

{{ languages ( {"es": "es/WebSockets"} ) }}

Revision Source

<p>{{ SeeCompatTable() }}</p>
<p>WebSockets is a technology that makes it possible to open an interactive communication session between the user's browser and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.</p>
<table class="topicpage-table"> <tbody> <tr> <td> <h4 name="Documentation"><a href="/Special:Tags?tag=WebSockets&amp;language=en" title="Special:Tags?tag=WebSockets&amp;language=en">Documentation</a></h4> <dl> <dt><a href="/en/WebSockets/Writing_WebSocket_client_applications" title="en/WebSockets/Writing WebSocket client applications">Writing WebSocket client applications</a></dt> <dd>A tutorial guide to writing WebSocket clients to run in the browser.</dd> <dt><a href="/en/WebSockets/WebSockets_reference" title="en/WebSockets/WebSockets reference">WebSockets reference</a></dt> <dd>A reference to the client-side WebSocket API.</dd> <dt><a href="/en/WebSockets/The_WebSocket_protocol" title="en/WebSockets/The WebSocket protocol">The WebSocket protocol</a></dt> <dd>A reference to the WebSocket protocol.</dd> <dt><a href="/en/WebSockets/Writing_WebSocket_servers" title="en/WebSockets/Writing WebSocket servers">Writing WebSocket servers</a></dt> <dd>A guide to writing server-side code to handle the WebSocket protocol.</dd> </dl> <p><span class="alllinks"><a href="/Special:Tags?tag=WebSockets&amp;language=en" title="Special:Tags?tag=WebSockets&amp;language=en">View All...</a></span></p> </td> <td> <h4 name="Tools">Tools</h4> <ul> <li><a class=" external" href="http://socket.io" title="http://socket.io/">Socket.IO</a>: A powerful cross-platform WebSocket API for <a class=" external" href="http://nodejs.org" title="http://nodejs.org/">Node.js</a>.</li> <li><a class=" link-https" href="https://github.com/Worlize/WebSocket-Node" title="https://github.com/Worlize/WebSocket-Node">WebSocket-Node</a>: A WebSocket server API implementation for <a class=" external" href="http://nodejs.org" title="http://nodejs.org/">Node.js</a>.</li> </ul> <p><span class="alllinks"><br> </span></p> <h4 name="Related_Topics">Related Topics</h4> <dl> <dd><a href="/en/AJAX" title="en/AJAX">AJAX</a>, <a href="/en/JavaScript" title="en/JavaScript">JavaScript</a></dd> </dl> </td> </tr> </tbody>
</table>
<h2>See also</h2>
<ul> <li><a class=" external" href="http://dev.w3.org/html5/websockets/" title="http://dev.w3.org/html5/websockets/">WebSocket API Specification</a></li> <li><a href="/en/Server-sent_events" title="en/Server-sent events">Server-Sent Events</a></li>
</ul>
<h2>Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
<table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Version -76 support {{ obsolete_inline() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatGeckoDesktop("2.0") }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> </tr> <tr> <td>Version IETF-07 support</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatGeckoDesktop("6.0") }} {{ property_prefix("-moz") }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> </tr> <tr> <td>Version IETF-08 support</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatGeckoDesktop("7.0") }} {{ property_prefix("-moz") }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> </tr> </tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Version -76 support {{ obsolete_inline() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> </tr> <tr> <td>Version IETF-07 support</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> </tr> <tr> <td>Version IETF-08 support</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatGeckoMobile("7.0") }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> </tr> </tbody>
</table>
</div>
<h3>Gecko notes</h3>
<p>WebSockets support in Firefox is continuing to track the evolving WebSocket specification. Firefox 6 implements version IETF-07 of the underlying protocol, while Firefox 7 implements version IETF-08. Firefox mobile received WebSocket support in Firefox mobile 7.0.</p>
<div class="note"><strong>Note:</strong> Starting in Gecko 7.0 {{ geckoRelease("7.0") }}, the <code>network.websocket.max-connections</code> preference is used to determine the maximum number of WebSocket connections that can be open at a time. The default value is 200.</div>
<div class="warning"><strong>Warning:</strong> Among other things, a key reason WebSockets is currently disabled by default in Firefox 4 and 5 is the discovery of a <a class=" external" href="http://www.ietf.org/mail-archive/web/hybi/current/msg04744.html" title="http://www.ietf.org/mail-archive/web/hybi/current/msg04744.html">security issue in the protocol's design</a>. Using WebSockets in those versions of Firefox in a production environment is not recommended at this time. If you still wish to experiment with WebSockets, you may do so by opening <code>about:config</code> and setting the <code>network.websocket.enabled</code> preference to <code>true</code>. You will also need to set the <code>network.websocket.override-security-block</code> preference to <code>true</code> in order to allow initializing a WebSocket connection.</div>
<p>{{ languages ( {"es": "es/WebSockets"} ) }}</p>
Revert to this revision