SlideShare a Scribd company logo
Java Day
     Web Sockets in
       Java EE 7
                                             February 23, 2013



Sivasubramaniam Arunachalam                       @sivaa_in


                  http://www.meetup.com/BangaloreOpenJUG/events/102904102/
It’s me!

• Application Developer
    • Web/Enterprise/Middleware/B2B
    • Java/Java EE, Python/Django
       •      2002

• Technical Consultant
• Process Mentor
•   Speaker
Agenda
• Introduction to Web Sockets
  • History
  • Protocol Spec
  • Adoption
• Java EE 7 Support
• Demo
Tweet Ping
Web 1.0

Web 2.0
Web 3.0
  Web 4.0
600+ M                                       Active Users/Day




https://www.facebook.com/sitetour/chat.php
1991


  http://             1995




Still 22 Years Old
                     2013
     http?
http/tcp
           (1991)    (1974)




request / response

    State less
   ~ 2k bytes

   ~ 150 ms
~ Real   Time
Pull Based (Polling)
             Periodic Polling (JS/AJAX)


                                Latest Score?
         AUS 312/7
                               Latest Score?
         Same
                               Latest Score?
         Same
Server                                          Client
                               Latest Score?
         AUS 316/7

                               Latest Score?
         Same
Push Based (Comet)
         Server Push/Long Polling (JS/AJAX/iframe)


                               Latest Score?
         AUS 312/7
                               Latest Score?




Server                                               Client

         AUS 316/7

                               Latest Score?
• Request / Response
 • Too Many
 • Server Connections
• Heavy Headers
• Outdated Content
Streaming Server Side Hack


                                Latest Score?
         AUS 312/7     (1/n)




Server                                          Client

         AUS 316/7    (2/n)



         IND 0/0      (n/n)
Latest Score?

                     (1/n)
         AUS 312/7   (n-1 to go)




Server                Server
                       Buffer                      Client

         AUS 316/7
                     (2/n)
                                     AUS 312/7
                     (n-2 to go)
                                     AUS 316/7
         IND 0/0                     IND 0/0
                     (n/n)

                     PROXY
Others
• RTMP
 • Adobe
 • Are you Still using Flash?


• RTD
 • Windows/Excel
 • Non Web
Web Sockets (to rescue)
The Web Socket Way    The Original Route


                                   Hey Server!
         Hi Client!

                            Update me the Score

         AUS 312/7

Server                                               Client
         AUS 316/7



         IND 0/0


                               Not Interested. Bye
Hey Server!
          Hi Client!

                            Update me the Score
          AUS 312/7

                            Update Over info too
                       (93.0 ov)
Server                 (94.0 ov)                   Client

          AUS 316/7

                       (95.0 ov)

         IND 0/0
                       (0.0 ov)

                             Not Interested. Bye
The Background
Let’s Meet Next Year (2014)
                   http://www.tavendo.de/webmq/resources/faq
Server Side        Client Side
 • Hand Shake       • Java Script API
 • Data Transfer    • Browser Behavior

   RFC 6455


                     http://www.tavendo.de/webmq/resources/faq
Fundamentals
•   tcp        + http

•   Full Duplex (Bi-Directional)
•   Native Browser Support
•   No Hacks
•   Not Limited to Web
The Spec
• 80 / 443 (plain/secure)
  • No Proxy/Firewall pains
• Stream of Messages (Not Bytes)
• ws:// & wss://
• Only ONE Connection (up/down streams)
Still Why?
2 Bytes Header            1000 x
     (for each message)




~ 50 ms (Latency)          3x
1 Message/Second per Client




  1,000 clients   10,000       clients      1,00,000         clients


                  http://www.codeproject.com/Articles/437342/DotNet-WebSocket-Programming
The Upgrade
• GET    (request)



• 101        (response code)

  • Not 200 OK
• http:// -> ws://
Client Request
GET /demo HTTP/1.1
Origin                 : http://sivaa.in
Host                   : sivaa.in

Connection             : Upgrade
Upgrade                : WebSocket
WebSocket-Protocol     : json, chat, <protocol>
WebSocket-Version      : 10
WebSocket-extensions   : compression, <extn>
Server Response
HTTP/1.1 101 Switching Protocols
 Connection           : Upgrade
 Upgrade              : WebSocket

 WebSocket-Protocol   : json, chat, <protocol>
 WebSocket-Origin     : http://sivaa.in
 WebSocket-Location   : ws://sivaa.in/demo
Challenge - Response
Challenge by Client
     Sec-WebSocket-Key : Key (Random 128 bits -> Base 64)

Response By Server
     Sec-WebSocket-Accept : Key + GUID* (SHA1)


                     [NOT FOR SECURITY]
* 258EAFA5-E914-47DA- 95CA-C5AB0DC85B11 (RFC 6455)
Client / Server


Peer <-> Peer
Data Transfer
• Frames (TCP)
•




• No request / response behavior
    •   No Correlation too
    •   Independent
    •   # of requests   !=   # of responses
And No
    • Headers
    • Cookies
    • Authentication
Sub Protocols
• Custom Message Patterns
• Technical / Business
• Request / Response
 •   1–1
 •   1 to Many
 •   Acknowledgements
Ping / Pong
•   Keep-Alive          Client -> Ping
•   Heart Beat          Server -> Pong
•   Latency Metrics
•   N/W Status Probing
•   Detect Failed Connections
Browser Support




       http://caniuse.com/#feat=websockets
IDL (Java Script)

Server Support



              http://www.w3.org/TR/websockets/
http://www.w3.org/TR/websockets/
http://www.w3.org/TR/websockets/
http://www.w3.org/TR/websockets/
http://www.w3.org/TR/websockets/
Developer Friendly
1.     var ws = new WebSocket("ws://sivaa.in/demo");
                                                       CONNECTING
2.     ws.onopen = function() {
           ws.send("Hello Server!");
                                     OPEN
       };

3.     ws.onmessage = function(event) {
           alert("Reply from Server " + event.data);
       };

n-1.   ws.send("This is the message sent by the client");

n.     ws.close()   CLOSING

        CLOSED
The Guards
             (Proxy / Firewall)



• Closing Long Lived Connections
  • Unresponsive Server
• Buffering Server Response
  • Non Encryption
  • More Latency
Web Sockets and
                 The Guards
• Web Sockets doesn’t Proxy
• Stripping HTTP Headers
    •   Upgrade
    •   Options to disable
•   Rejecting Server Response
    •   Frames (HTTP Headers Expected)
•   wss:// - No issues
The Hidden Blades
• 301
• Limited Support
• Inconsistent Behavior
Java EE 7 & Web Socket
• JSR 356
• Java EE 7
• Tyrus ( http://tyrus.java.net/ )


  • Web Socket SDK
  • Reference Implementation
Server Side Capabilities
             (Expected)

 •   Handshake Response to Clients
 •   Source/Origin Check
 •   URI Resolving & Matching
 •   Sub Protocols Negotiation
 •   Extension Negotiation
Handlers
•   End point (to handle life cycle events)
•   Session (Current Active Session)
•   Remote End Point (Peer)
•   Message Handler (incoming messages)
•   Error Handler
Packages
• javax.websocket.*
• javax.net.websocket.*

http://java.net/projects/websocket-spec/sources/source-code-
repository/show/tags/javax.net.websocket-api-1.0-b08/src/main/java?rev=213
Web Server Support
•   Apache Tomcat 7
•   GlassFish 3.1
•   Jetty 7
•   JBoss 7
•   And much more
GlassFish
•   Annotations
•   Reference Implementation
•   Web Sockets SDK / mvn
•   Samples to Begin with
Demo
• GlassFish Promoted Build
•   # svn checkout https://svn.java.net/svn/websocket-sdk~source-code-repository
•   # mvn clean install (in websocket-sdk~source-code-repositorytrunksamples)

• Import in Latest Net Beans
• Run it
Thank You!
            siva@sivaa.in
bit.ly/sivaa_in      bit.ly/sivasubramaniam
References
•   http://www.inc.com/ss/brief-history-time-management#7
•   http://resources3.news.com.au/images/2013/01/30/1226564/845955-tim-berners-lee.jpg
•   http://netdna.webdesignerdepot.com/uploads/2009/01/macii.jpg#old%20apple%20computer%20559x450
•   http://3.bp.blogspot.com/_zVkfb2MIt4A/S8f_qzhuhRI/AAAAAAAAAjg/2idf7_G4wxo/s1600/apple-imac.png
•   http://www.softwareforeducation.com/wikileki/images/c/c4/Simplex-half-full.gif
•   http://www.mediafly.com/wp-content/uploads/Speed_Rocket-2.png
•   http://weaponsman.com/wp-content/uploads/2013/01/thumbs-down.png
•   http://m.flikie.com/ImageData/WallPapers/d1bef9f8be6d479387953929c766699a.jpg
•   http://www.tavendo.de/webmq/resources/faq
•   http://deadliestwebattacks.com/tag/websocket/
•   http://en.wikipedia.org/wiki/WebSocket
•   http://www.infoq.com/articles/Web-Sockets-Proxy-Servers

More Related Content

PDF
Web sockets in java EE 7 - JavaOne 2013
PPTX
Php push notifications
PDF
Introduction to WebSockets
KEY
Pushing the web — WebSockets
PPTX
WebSocket protocol
PPTX
HTML5 WebSocket Introduction
PDF
vCenter and ESXi network port communications
PPTX
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
Web sockets in java EE 7 - JavaOne 2013
Php push notifications
Introduction to WebSockets
Pushing the web — WebSockets
WebSocket protocol
HTML5 WebSocket Introduction
vCenter and ESXi network port communications
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)

What's hot (20)

PDF
Nuts and Bolts of WebSocket Devoxx 2014
PDF
Jetty Continuation - 이상민
PPT
Life on the Edge with ESI
PDF
Great Java Application Server Debate
PDF
Do We Need Containers Anyway?
PDF
Jetty 9 – The Next Generation Servlet Container
PDF
HTML5 WebSockets
PDF
IBM Think 2018 - IBM Connections Troubleshooting
PDF
HTTP 2.0 – What do I need to know?
KEY
The HTML5 WebSocket API
PPTX
Webinar: IBM Connections Adminblast
PPTX
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
PPT
HTML5 WebSocket: The New Network Stack for the Web
PPTX
vlavrynovych - WebSockets Presentation
PPTX
SPDY - or maybe HTTP2.0
PDF
Java EE 7 Soup to Nuts at JavaOne 2014
PPTX
Nexcess Magento Imagine 2014 Performance Breakout
PPTX
Intro to WebSockets
ZIP
Websocket protocol overview
Nuts and Bolts of WebSocket Devoxx 2014
Jetty Continuation - 이상민
Life on the Edge with ESI
Great Java Application Server Debate
Do We Need Containers Anyway?
Jetty 9 – The Next Generation Servlet Container
HTML5 WebSockets
IBM Think 2018 - IBM Connections Troubleshooting
HTTP 2.0 – What do I need to know?
The HTML5 WebSocket API
Webinar: IBM Connections Adminblast
CollabSphere SC 103 : Domino on the Web : Yes, It's (Probably) Hackable
HTML5 WebSocket: The New Network Stack for the Web
vlavrynovych - WebSockets Presentation
SPDY - or maybe HTTP2.0
Java EE 7 Soup to Nuts at JavaOne 2014
Nexcess Magento Imagine 2014 Performance Breakout
Intro to WebSockets
Websocket protocol overview
Ad

Viewers also liked (17)

PPTX
cloud conference 2013 - Infrastructure as a Service in Amazon Web Services
KEY
Getting Started with WebGL
PPT
Web gl game development
PDF
WebGL and three.js
PPTX
Open stack implementation
PDF
Open Stack vs .NET Stack - For Startups
PPT
Open gl
PPTX
Module 4: NETCONF Tutorial
PPTX
Amazon Web Service EC2 & S3
PDF
OpenGLES - Graphics Programming in Android
PDF
Introduction to WebSockets Presentation
PPTX
Geometría lineal
PPT
Distributed computing
ODP
Distributed Computing
PDF
Initial presentation of openstack (for montreal user group)
PPSX
Introduction to .net framework
PPTX
Distributed Computing
cloud conference 2013 - Infrastructure as a Service in Amazon Web Services
Getting Started with WebGL
Web gl game development
WebGL and three.js
Open stack implementation
Open Stack vs .NET Stack - For Startups
Open gl
Module 4: NETCONF Tutorial
Amazon Web Service EC2 & S3
OpenGLES - Graphics Programming in Android
Introduction to WebSockets Presentation
Geometría lineal
Distributed computing
Distributed Computing
Initial presentation of openstack (for montreal user group)
Introduction to .net framework
Distributed Computing
Ad

Similar to Web Sockets in Java EE 7 (20)

PPTX
Writing Portable WebSockets in Java
PPTX
Building WebSocket and Server Side Events Applications using Atmosphere
PPTX
V2 peter-lubbers-sf-jug-websocket
PDF
Intro to WebSockets and Comet
PDF
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
PDF
Dev con kolkata 2012 websockets
PDF
Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012
PDF
Server-Side Programming Primer
PPTX
Codecamp Iasi-26 nov 2011 - Html 5 WebSockets
PPTX
Codecamp iasi-26 nov 2011-web sockets
PDF
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
PPTX
Programming WebSockets with Glassfish and Grizzly
PDF
HTML5 Websockets and Java - Arun Gupta
PDF
Html6 forgotten in html5
PPTX
WebSockets in JEE 7
PPT
PPTX
Real time websites and mobile apps with SignalR
PDF
Websocket 1.0
PPTX
Web technologies: HTTP
Writing Portable WebSockets in Java
Building WebSocket and Server Side Events Applications using Atmosphere
V2 peter-lubbers-sf-jug-websocket
Intro to WebSockets and Comet
Html5 web sockets - Brad Drysdale - London Web 2011-10-20
Dev con kolkata 2012 websockets
Building HTML5 WebSocket Apps in Java at JavaOne Latin America 2012
Server-Side Programming Primer
Codecamp Iasi-26 nov 2011 - Html 5 WebSockets
Codecamp iasi-26 nov 2011-web sockets
WebSockets: The Current State of the Most Valuable HTML5 API for Java Developers
Programming WebSockets with Glassfish and Grizzly
HTML5 Websockets and Java - Arun Gupta
Html6 forgotten in html5
WebSockets in JEE 7
Real time websites and mobile apps with SignalR
Websocket 1.0
Web technologies: HTTP

More from Siva Arunachalam (17)

PDF
Introduction to EDI(Electronic Data Interchange)
PDF
Introduction to logging in django
PDF
Introduction to Test Driven Development
PDF
Setup a New Virtualenv for Django in Windows
PDF
What's New in Django 1.6
PDF
Introduction to Browser Internals
PDF
Python for High School Programmers
PDF
Introduction to Cloud Computing
PDF
Simplify AJAX using jQuery
PDF
Introduction to Browser DOM
PDF
jQuery for beginners
PDF
Installing MySQL for Python
PDF
Using Eclipse and Installing PyDev
PPT
Installing Python 2.7 in Windows
PDF
Setup a New Virtualenv for Django in Windows
PPT
Introduction to Google APIs
PDF
Introduction to Django
Introduction to EDI(Electronic Data Interchange)
Introduction to logging in django
Introduction to Test Driven Development
Setup a New Virtualenv for Django in Windows
What's New in Django 1.6
Introduction to Browser Internals
Python for High School Programmers
Introduction to Cloud Computing
Simplify AJAX using jQuery
Introduction to Browser DOM
jQuery for beginners
Installing MySQL for Python
Using Eclipse and Installing PyDev
Installing Python 2.7 in Windows
Setup a New Virtualenv for Django in Windows
Introduction to Google APIs
Introduction to Django

Recently uploaded (20)

PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPT
Teaching material agriculture food technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
KodekX | Application Modernization Development
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation theory and applications.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
NewMind AI Weekly Chronicles - August'25 Week I
Building Integrated photovoltaic BIPV_UPV.pdf
Teaching material agriculture food technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
KodekX | Application Modernization Development
Programs and apps: productivity, graphics, security and other tools
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
20250228 LYD VKU AI Blended-Learning.pptx
Empathic Computing: Creating Shared Understanding
Digital-Transformation-Roadmap-for-Companies.pptx
The AUB Centre for AI in Media Proposal.docx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Dropbox Q2 2025 Financial Results & Investor Presentation
Agricultural_Statistics_at_a_Glance_2022_0.pdf
MYSQL Presentation for SQL database connectivity
Encapsulation theory and applications.pdf
Understanding_Digital_Forensics_Presentation.pptx

Web Sockets in Java EE 7

  • 1. Java Day Web Sockets in Java EE 7 February 23, 2013 Sivasubramaniam Arunachalam @sivaa_in http://www.meetup.com/BangaloreOpenJUG/events/102904102/
  • 2. It’s me! • Application Developer • Web/Enterprise/Middleware/B2B • Java/Java EE, Python/Django • 2002 • Technical Consultant • Process Mentor • Speaker
  • 3. Agenda • Introduction to Web Sockets • History • Protocol Spec • Adoption • Java EE 7 Support • Demo
  • 5. Web 1.0 Web 2.0 Web 3.0 Web 4.0
  • 6. 600+ M Active Users/Day https://www.facebook.com/sitetour/chat.php
  • 7. 1991 http:// 1995 Still 22 Years Old 2013 http?
  • 8. http/tcp (1991) (1974) request / response State less ~ 2k bytes ~ 150 ms
  • 9. ~ Real Time
  • 10. Pull Based (Polling) Periodic Polling (JS/AJAX) Latest Score? AUS 312/7 Latest Score? Same Latest Score? Same Server Client Latest Score? AUS 316/7 Latest Score? Same
  • 11. Push Based (Comet) Server Push/Long Polling (JS/AJAX/iframe) Latest Score? AUS 312/7 Latest Score? Server Client AUS 316/7 Latest Score?
  • 12. • Request / Response • Too Many • Server Connections • Heavy Headers • Outdated Content
  • 13. Streaming Server Side Hack Latest Score? AUS 312/7 (1/n) Server Client AUS 316/7 (2/n) IND 0/0 (n/n)
  • 14. Latest Score? (1/n) AUS 312/7 (n-1 to go) Server Server Buffer Client AUS 316/7 (2/n) AUS 312/7 (n-2 to go) AUS 316/7 IND 0/0 IND 0/0 (n/n) PROXY
  • 15. Others • RTMP • Adobe • Are you Still using Flash? • RTD • Windows/Excel • Non Web
  • 16. Web Sockets (to rescue)
  • 17. The Web Socket Way The Original Route Hey Server! Hi Client! Update me the Score AUS 312/7 Server Client AUS 316/7 IND 0/0 Not Interested. Bye
  • 18. Hey Server! Hi Client! Update me the Score AUS 312/7 Update Over info too (93.0 ov) Server (94.0 ov) Client AUS 316/7 (95.0 ov) IND 0/0 (0.0 ov) Not Interested. Bye
  • 20. Let’s Meet Next Year (2014) http://www.tavendo.de/webmq/resources/faq
  • 21. Server Side Client Side • Hand Shake • Java Script API • Data Transfer • Browser Behavior RFC 6455 http://www.tavendo.de/webmq/resources/faq
  • 22. Fundamentals • tcp + http • Full Duplex (Bi-Directional) • Native Browser Support • No Hacks • Not Limited to Web
  • 23. The Spec • 80 / 443 (plain/secure) • No Proxy/Firewall pains • Stream of Messages (Not Bytes) • ws:// & wss:// • Only ONE Connection (up/down streams)
  • 24. Still Why? 2 Bytes Header 1000 x (for each message) ~ 50 ms (Latency) 3x
  • 25. 1 Message/Second per Client 1,000 clients 10,000 clients 1,00,000 clients http://www.codeproject.com/Articles/437342/DotNet-WebSocket-Programming
  • 26. The Upgrade • GET (request) • 101 (response code) • Not 200 OK • http:// -> ws://
  • 27. Client Request GET /demo HTTP/1.1 Origin : http://sivaa.in Host : sivaa.in Connection : Upgrade Upgrade : WebSocket WebSocket-Protocol : json, chat, <protocol> WebSocket-Version : 10 WebSocket-extensions : compression, <extn>
  • 28. Server Response HTTP/1.1 101 Switching Protocols Connection : Upgrade Upgrade : WebSocket WebSocket-Protocol : json, chat, <protocol> WebSocket-Origin : http://sivaa.in WebSocket-Location : ws://sivaa.in/demo
  • 29. Challenge - Response Challenge by Client Sec-WebSocket-Key : Key (Random 128 bits -> Base 64) Response By Server Sec-WebSocket-Accept : Key + GUID* (SHA1) [NOT FOR SECURITY] * 258EAFA5-E914-47DA- 95CA-C5AB0DC85B11 (RFC 6455)
  • 31. Data Transfer • Frames (TCP) • • No request / response behavior • No Correlation too • Independent • # of requests != # of responses
  • 32. And No • Headers • Cookies • Authentication
  • 33. Sub Protocols • Custom Message Patterns • Technical / Business • Request / Response • 1–1 • 1 to Many • Acknowledgements
  • 34. Ping / Pong • Keep-Alive Client -> Ping • Heart Beat Server -> Pong • Latency Metrics • N/W Status Probing • Detect Failed Connections
  • 35. Browser Support http://caniuse.com/#feat=websockets
  • 36. IDL (Java Script) Server Support http://www.w3.org/TR/websockets/
  • 41. Developer Friendly 1. var ws = new WebSocket("ws://sivaa.in/demo"); CONNECTING 2. ws.onopen = function() { ws.send("Hello Server!"); OPEN }; 3. ws.onmessage = function(event) { alert("Reply from Server " + event.data); }; n-1. ws.send("This is the message sent by the client"); n. ws.close() CLOSING CLOSED
  • 42. The Guards (Proxy / Firewall) • Closing Long Lived Connections • Unresponsive Server • Buffering Server Response • Non Encryption • More Latency
  • 43. Web Sockets and The Guards • Web Sockets doesn’t Proxy • Stripping HTTP Headers • Upgrade • Options to disable • Rejecting Server Response • Frames (HTTP Headers Expected) • wss:// - No issues
  • 44. The Hidden Blades • 301 • Limited Support • Inconsistent Behavior
  • 45. Java EE 7 & Web Socket • JSR 356 • Java EE 7 • Tyrus ( http://tyrus.java.net/ ) • Web Socket SDK • Reference Implementation
  • 46. Server Side Capabilities (Expected) • Handshake Response to Clients • Source/Origin Check • URI Resolving & Matching • Sub Protocols Negotiation • Extension Negotiation
  • 47. Handlers • End point (to handle life cycle events) • Session (Current Active Session) • Remote End Point (Peer) • Message Handler (incoming messages) • Error Handler
  • 49. Web Server Support • Apache Tomcat 7 • GlassFish 3.1 • Jetty 7 • JBoss 7 • And much more
  • 50. GlassFish • Annotations • Reference Implementation • Web Sockets SDK / mvn • Samples to Begin with
  • 51. Demo • GlassFish Promoted Build • # svn checkout https://svn.java.net/svn/websocket-sdk~source-code-repository • # mvn clean install (in websocket-sdk~source-code-repositorytrunksamples) • Import in Latest Net Beans • Run it
  • 52. Thank You! siva@sivaa.in bit.ly/sivaa_in bit.ly/sivasubramaniam
  • 53. References • http://www.inc.com/ss/brief-history-time-management#7 • http://resources3.news.com.au/images/2013/01/30/1226564/845955-tim-berners-lee.jpg • http://netdna.webdesignerdepot.com/uploads/2009/01/macii.jpg#old%20apple%20computer%20559x450 • http://3.bp.blogspot.com/_zVkfb2MIt4A/S8f_qzhuhRI/AAAAAAAAAjg/2idf7_G4wxo/s1600/apple-imac.png • http://www.softwareforeducation.com/wikileki/images/c/c4/Simplex-half-full.gif • http://www.mediafly.com/wp-content/uploads/Speed_Rocket-2.png • http://weaponsman.com/wp-content/uploads/2013/01/thumbs-down.png • http://m.flikie.com/ImageData/WallPapers/d1bef9f8be6d479387953929c766699a.jpg • http://www.tavendo.de/webmq/resources/faq • http://deadliestwebattacks.com/tag/websocket/ • http://en.wikipedia.org/wiki/WebSocket • http://www.infoq.com/articles/Web-Sockets-Proxy-Servers