Your SlideShare is downloading. ×
Websocket
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Websocket

562
views

Published on

Pequena Apresentação de websocket.

Pequena Apresentação de websocket.

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
562
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Websockets APRESENTAÇÃO Denis Encarnação 14/01/2012
  • 2. HTTP ● WEBSOCKETS ● Futuro ● Implementações ● Tecnologias ● Outras tecnologias existentes ● Desvantagens ● Resumo ● Questões ●
  • 3. HTTP/1.1 GET /tutorials/other/top-20-mysql-best-practices/ HTTP/1.1 Host: net.tutsplus.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Connection: keep-alive Cookie: PHPSESSID=r2t5uvjq435r4q7ib3vtdjq120 Pragma: no-cache Cache-Control: no-cache HTTP/1.x 200 OK Transfer-Encoding: chunked Date: Sat, 28 Nov 2009 04:36:25 GMT Server: LiteSpeed Connection: close X-Powered-By: W3 Total Cache/0.8 Pragma: public Expires: Sat, 28 Nov 2009 05:36:25 GMT Etag: "pub1259380237;gz" Cache-Control: max-age=3600, public Content-Type: text/html; charset=UTF-8 Last-Modified: Sat, 28 Nov 2009 03:50:37 GMT X-Pingback: http://net.tutsplus.com/xmlrpc.php Content-Encoding: gzip Vary: Accept-Encoding, Cookie, User-Agent
  • 4. HTTP/1.1
  • 5. HTTP/1.1 ● Caching ● Autenticação ● Pipeline ● Cookies ● Compressão ● Ligação Permanente
  • 6. WEBSOCKETS RFC6455
  • 7. WEBSOCKETS ● Comunicação em tempo real ● HTTP ● TCP ● HTML5 ● API
  • 8. WEBSOCKETS ws://server.example.com/chat wss://server.example.com/chat GET /chat HTTP/1.1 HTTP/1.1 101 Switching Protocols Host: server.example.com Upgrade: websocket Upgrade: websocket Connection: Upgrade Connection: Upgrade Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo= Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== Origin: http://example.com Sec-WebSocket-Protocol: chat, superchat Sec-WebSocket-Version: 13 Sec-WebSocket-Protocol: chat
  • 9. WEBSOCKETS
  • 10. WEBSOCKETS ● Comunicação em tempo real ● HTTP ● TCP ● HTML5 ● API ● Relatório de Erros
  • 11. WEBSOCKETS var connection = new WebSocket('ws://html5rocks.websocket.org/echo'); connection.onopen = function () { connection.send('Ping'); }; connection.onerror = function (error) { console.log('WebSocket Error ' + error); }; connection.onmessage = function (e) { console.log('Server: ' + e.data); };
  • 12. Futuro ● Sem limite ● Porta dedicada ● Compressão dos dados ● Binário na API
  • 13. Implementações ● Node.js ● Tornado ● Twisted ● Autobahn ● Jetty
  • 14. Tecnologias
  • 15. Outras Tecnologias Existentes
  • 16. Outras Tecnologias Existentes Short Polling
  • 17. Outras Tecnologias Existentes Long Polling Comet Reque st s Respon e Client Reques t Server
  • 18. Outras Tecnologias Existentes Long Polling Bosh Request Client Server
  • 19. Outras Tecnologias Existentes Long Polling Bosh Request Reques t Client Server Response
  • 20. Outras Tecnologias Existentes Long Polling
  • 21. Outras Tecnologias Existentes Streaming Reques t se Respon onse Resp onse Resp Client Server
  • 22. Outras Tecnologias Existentes Server Sent Events Content-type text/event-stream
  • 23. Desvantagens
  • 24. Resumo ● ● Jogos ● Não é necessário hacking Messenger ● Leve nos dados ● ● Documentos Pouca latência ● ● ● Comunicação com Colaboração Bilhetes Online qualquer tecnologia ● Extensível
  • 25. Questões

×