diff options
Diffstat (limited to 'files/pt-br/web/api/server-sent_events/index.html')
| -rw-r--r-- | files/pt-br/web/api/server-sent_events/index.html | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/files/pt-br/web/api/server-sent_events/index.html b/files/pt-br/web/api/server-sent_events/index.html new file mode 100644 index 0000000000..4a7f8eb1b7 --- /dev/null +++ b/files/pt-br/web/api/server-sent_events/index.html @@ -0,0 +1,79 @@ +--- +title: Server-sent events +slug: Web/API/Server-sent_events +tags: + - API + - NeedsTranslation + - Overview + - SSE + - Server-sent events + - TopicStub +translation_of: Web/API/Server-sent_events +--- +<p>{{DefaultAPISidebar("Server Sent Events")}}</p> + +<p>Traditionally, a web page has to send a request to the server to receive new data; that is, the page requests data from the server. With server-sent events, it's possible for a server to send new data to a web page at any time, by pushing messages to the web page. These incoming messages can be treated as <em><a href="/en-US/docs/DOM/event">Events</a> + data</em> inside the web page.</p> + +<h2 id="Concepts_and_usage">Concepts and usage</h2> + +<p>To learn how to use server-sent events, see our article <a href="/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events">Using server-sent events</a>.</p> + +<h2 id="Interfaces" name="Interfaces">Interfaces</h2> + +<dl> + <dt>{{domxref("EventSource")}}</dt> + <dd>Defines all the features that handle connecting to a server, receiving events/data, errors, closing a connection, etc.</dd> +</dl> + +<h2 id="Examples">Examples</h2> + +<ul> + <li><a href="https://github.com/mdn/dom-examples/tree/master/server-sent-events">Simple SSE demo using PHP</a></li> +</ul> + +<h2 id="Specification">Specification</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('HTML WHATWG', '#server-sent-events', 'Server-sent events')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="See_also" name="See_also">See also</h2> + +<h3 id="Tools" name="Tools">Tools</h3> + +<ul> + <li><a href="https://github.com/EventSource/eventsource">EventSource polyfill for Node.js</a></li> + <li>Remy Sharp’s <a class="link-https" href="https://github.com/remy/polyfills/blob/master/EventSource.js">EventSource polyfill</a></li> + <li>Yaffle’s <a class="link-https" href="https://github.com/Yaffle/EventSource" title="https://github.com/Yaffle/EventSource">EventSource polyfill</a></li> + <li>Rick Waldron’s <a class="link-https" href="https://github.com/rwldrn/jquery.eventsource">jquery plugin</a></li> + <li>intercooler.js <a href="http://intercoolerjs.org/docs.html#sse">declarative SSE support</a></li> +</ul> + +<h3 id="Related_Topics" name="Related_Topics">Related Topics</h3> + +<ul> + <li><a href="/en-US/docs/AJAX" title="AJAX">AJAX</a></li> + <li><a href="/en-US/docs/JavaScript" title="JavaScript">JavaScript</a></li> + <li><a href="/en-US/docs/WebSockets" title="WebSockets">WebSockets</a></li> +</ul> + +<h3 id="Other_resources">Other resources</h3> + +<ul> + <li>A <a href="http://hacks.mozilla.org/2011/06/a-wall-powered-by-eventsource-and-server-sent-events/" title="http://hacks.mozilla.org/2011/06/a-wall-powered-by-eventsource-and-server-sent-events/">Twitter like application</a> powered by server-sent events and <a class="link-https" href="https://github.com/mozilla/webowonder-demos/tree/master/demos/friends%20timeline" title="https://github.com/mozilla/webowonder-demos/tree/master/demos/friends timeline">its code on Github</a>.</li> + <li><a href="http://dsheiko.com/weblog/html5-and-server-sent-events" title="http://dsheiko.com/weblog/html5-and-server-sent-events">HTML5 and Server-sent events</a></li> + <li><a href="http://rajudasa.blogspot.in/2012/05/html5-server-sent-events-using-aspnet.html" title="http://rajudasa.blogspot.in/2012/05/html5-server-sent-events-using-aspnet.html">Server-sent events using Asp.Net</a></li> +</ul> |
