SlideShare a Scribd company logo
ColdFusion Summit 2016
Realtime with WebSockets w/ Giancarlo Gomez
Realtime with WebSockets
Who am I?
‣ Proud Father of 3
‣ Web Developer since 1999
‣ Freelance since 2001
‣ South Florida ColdFusion User Group Co-Manager
‣ Owner of Fuse Developments, Inc. and CrossTrackr, Inc.
Realtime with WebSockets
What are WebSockets?
WebSockets are a full-duplex, persistent connection from a client to a server over a single
TCP Connection. Once the connection is established, it stays open until the client or
server decide to close the connection. This makes web programming entirely event
driven, not (just) user initiated. It is stateful, as a single running server is aware of all
connections, allowing you to communicate with any number of them at any given time.
Blah Blah Blah …
Show me what I can do with this
and I don’t mean chat.
Realtime with WebSockets
HTTP Architecture
Request
Response
Half-Duplex Communication
Realtime with WebSockets
Short Polling
Request
Response
Loop AJAX Request on client side and ask the server for an update
6
Realtime with WebSockets
Long Polling
Request
Response
Send AJAX request to server, request loops on server until there is a

response and then returns to client and processes starts over again.
Realtime with WebSockets
WebSockets
Handshake (HTTP Upgrade)
Bidirectional Messaging
open and persistent connection
On side closes channel
connection closed
Realtime with WebSockets
WebSockets in ColdFusion
‣ Supported as of ColdFusion 10
‣ Support over defined port 

Defaults to 8575
‣ Flash Fallback 

Port 1243

Defined in lib/neo-websocket.xml
‣ Set Max Data Size (1024 Kb)
‣ 100 Connection Limit on Standard

* Unlimited in Enterprise
‣ Introduced in ColdFusion 11
‣ No Connection Limits
‣ Proxy Support 

Great when behind a firewall and easier when
dealing with SSL and multiple domains
‣ SSL Support

Browsers no longer allow for non-secure
connections over secured connections
‣ Cluster Support

* Enterprise Only
Realtime with WebSockets
Enable WebSockets in ColdFusion in “4 EASY STEPS”
‣ Enable in Admin
‣ Add 1 Line in your Application.cfc
‣ Use the cfwebsocket tag
‣ Write some JavaScript and get creative
Realtime with WebSockets
ColdFusion 10 Admin
Realtime with WebSockets
ColdFusion 11 Admin
Using Proxy Standard Enterprise
DEMO 01
4 easy steps and a little bit more …
Realtime with WebSockets
Secure WebSockets - WSS
‣ Easiest Method, use Proxy. It relies on the SSL certificates defined for the site. Requires …
‣ IIS8+ with WebSocket Protocol Enabled
‣ Apache 2.2+ compiled with worker module not prefork (Apache MPM Worker)
‣ Using Built in WebSocket Server
‣ Create JKS (Java KeyStore) or PKCS12 file.
‣ JVM Setting (Fixes SSLException Error) 

-Dcom.sun.net.ssl.enableECC=false
‣ If using self-assigned certificate
‣ Add certificate as a trusted certificate in Java keystore

* this will fix issues with cfhttp calls as well - the following might as well

-Dsun.security.ssl.allowUnsafeRenegotiation=true -Djsse.enableSNIExtension=false
‣ Trust the certificate using your browser
Realtime with WebSockets
Secure WebSockets - WSS - Server Requirements
Realtime with WebSockets
Secure WebSockets - WSS - Proxy w/ IIS
DEMO 02
What do you mean it does not work?
Realtime with WebSockets
WebSocket Clusters
Instance A
Client A Client B
Instance B
Client C Client D
Realtime with WebSockets
WebSockets Clusters
▸ Must use built in WebSocket Server
▸ Create Instances in Instance Manager
▸ Define Cluster
▸ Rebuild Connections
▸ Turn on WebSocket clustering on all instances
▸ Have fun testing ….
Realtime with WebSockets
Real World Uses
‣ Dashboards (Stocks, Airlines, …)
‣ Auctions Sites
‣ Chat
‣ Push Messaging (email, notifications, etc)
‣ Games
‣ Use your imagination … anything is possible
Real World Issues!!!
Me and every other Developer
‣ Network Connections
‣ Application Reloads
‣ Server Uptime
Realtime with WebSockets
Hello AdvancedSocket
‣ Easily integrates with cfwebsocket
‣ Callbacks for connection drops that easily lets you add notifications to for users
‣ Application Reinit
‣ Server Downtime
‣ Network Connection
‣ Automatically reconnect to subscribed channels
DEMO 03
Wait, they gave me something kind of broken?
DEMO 04
Ok show me how easy it is to build an app …
Now we chat
DEMO 05
I don’t meet the requirements.
What can I do?
Realtime with WebSockets
Helpful Links
‣ Repos
‣ https://github.com/GiancarloGomez/Realtime-With-WebSockets-Demo-Code
‣ https://github.com/GiancarloGomez/AdvancedSocket
‣ https://github.com/GiancarloGomez/ColdFusion-CFSummit-WebSockets
‣ SSL Related Links
‣ https://blog.httpwatch.com/2013/12/12/five-tips-for-using-self-signed-ssl-certificates-with-ios/
‣ https://info.ssl.com/how-to-create-a-pfx-p12-certificate-file-using-openssl/
‣ ColdFusion Articles
‣ http://www.adobe.com/devnet/coldfusion/articles/html5-websockets-coldfusion-pt1.html
‣ http://www.adobe.com/devnet/coldfusion/articles/html5-websockets-coldfusion-pt2.html
‣ http://www.adobe.com/devnet/coldfusion/articles/using-websocket.html
‣ https://helpx.adobe.com/coldfusion/developing-applications/coldfusion-and-html-5/using-coldfusion-websocket/websocket-enhancements.html
‣ WebSockets (Server / Services)
‣ http://socket.io/
‣ https://www.pubnub.com/
‣ https://pusher.com/
http://giancarlogomez.com
giancarlo.gomez@gmail.com
@GiancarloGomez
https://github.com/GiancarloGomez
https://www.linkedin.com/in/giancarlogomez
Q & A

More Related Content

PPTX
CompTIA Network+ Training Courses
PDF
Konsep dan implementasi nat
PDF
CCNAv5 - S2: Chapter3 Vlans
PDF
Support formation vidéo : Cisco ASA, configuration
PPTX
CCNA 1 Routing and Switching v5.0 Chapter 9
PDF
netis WF2412無線橋接模式 – WISP
PDF
Configuring Cisco Routing Protocols
CompTIA Network+ Training Courses
Konsep dan implementasi nat
CCNAv5 - S2: Chapter3 Vlans
Support formation vidéo : Cisco ASA, configuration
CCNA 1 Routing and Switching v5.0 Chapter 9
netis WF2412無線橋接模式 – WISP
Configuring Cisco Routing Protocols

Similar to Realtime with websockets (20)

PDF
Realtime with-websockets-2015
PDF
Real Time With Web Sockets
PDF
Using WebSockets with ColdFusion
PDF
Let web sockets hit that f5 for you
PPTX
Training Webinar: Enterprise application performance with server push technol...
PPTX
WebSockets-Revolutionizing-Real-Time-Communication.pptx
PPTX
Programming WebSockets with Glassfish and Grizzly
PPTX
ClientServer Websocket.pptx
PPTX
WebSockets in JEE 7
PPTX
Websockets
PPTX
Web Sockets are not Just for Web Browsers
PPTX
Websockets: Pushing the web forward
PDF
Dev con kolkata 2012 websockets
PPTX
Enhancing Mobile User Experience with WebSocket
PDF
Building Next Generation Real-Time Web Applications using Websockets
PDF
Real-time applications with sockets and websockets. Introduction to Smartfoxs...
PDF
WebSocket Push Fallback - Transcript.pdf
ODP
Building interactivity with websockets
PDF
Building interactivity with websockets
PPTX
WebSocket protocol
Realtime with-websockets-2015
Real Time With Web Sockets
Using WebSockets with ColdFusion
Let web sockets hit that f5 for you
Training Webinar: Enterprise application performance with server push technol...
WebSockets-Revolutionizing-Real-Time-Communication.pptx
Programming WebSockets with Glassfish and Grizzly
ClientServer Websocket.pptx
WebSockets in JEE 7
Websockets
Web Sockets are not Just for Web Browsers
Websockets: Pushing the web forward
Dev con kolkata 2012 websockets
Enhancing Mobile User Experience with WebSocket
Building Next Generation Real-Time Web Applications using Websockets
Real-time applications with sockets and websockets. Introduction to Smartfoxs...
WebSocket Push Fallback - Transcript.pdf
Building interactivity with websockets
Building interactivity with websockets
WebSocket protocol
Ad

More from ColdFusionConference (20)

PDF
Api manager preconference
PDF
PDF
Building better SQL Server Databases
PDF
API Economy, Realizing the Business Value of APIs
PDF
Don't just pdf, Smart PDF
PDF
Crafting ColdFusion Applications like an Architect
PDF
Security And Access Control For APIS using CF API Manager
PDF
Monetizing Business Models: ColdFusion and APIS
PDF
Become a Security Rockstar with ColdFusion 2016
PDF
ColdFusion in Transit action
PDF
Developer Insights for Application Upgrade to ColdFusion 2016
PDF
Where is cold fusion headed
PDF
ColdFusion Keynote: Building the Agile Web Since 1995
PDF
Instant ColdFusion with Vagrant
PPT
Restful services with ColdFusion
PDF
Super Fast Application development with Mura CMS
PDF
Build your own secure and real-time dashboard for mobile and web
PDF
Why Everyone else writes bad code
PDF
Securing applications
PDF
Testing automaton
Api manager preconference
Building better SQL Server Databases
API Economy, Realizing the Business Value of APIs
Don't just pdf, Smart PDF
Crafting ColdFusion Applications like an Architect
Security And Access Control For APIS using CF API Manager
Monetizing Business Models: ColdFusion and APIS
Become a Security Rockstar with ColdFusion 2016
ColdFusion in Transit action
Developer Insights for Application Upgrade to ColdFusion 2016
Where is cold fusion headed
ColdFusion Keynote: Building the Agile Web Since 1995
Instant ColdFusion with Vagrant
Restful services with ColdFusion
Super Fast Application development with Mura CMS
Build your own secure and real-time dashboard for mobile and web
Why Everyone else writes bad code
Securing applications
Testing automaton
Ad

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Cloud computing and distributed systems.
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPT
Teaching material agriculture food technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Cloud computing and distributed systems.
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Digital-Transformation-Roadmap-for-Companies.pptx
20250228 LYD VKU AI Blended-Learning.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Teaching material agriculture food technology
Understanding_Digital_Forensics_Presentation.pptx
NewMind AI Monthly Chronicles - July 2025
Building Integrated photovoltaic BIPV_UPV.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Weekly Chronicles - August'25 Week I
Reach Out and Touch Someone: Haptics and Empathic Computing
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
Encapsulation_ Review paper, used for researhc scholars
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Realtime with websockets

  • 1. ColdFusion Summit 2016 Realtime with WebSockets w/ Giancarlo Gomez
  • 2. Realtime with WebSockets Who am I? ‣ Proud Father of 3 ‣ Web Developer since 1999 ‣ Freelance since 2001 ‣ South Florida ColdFusion User Group Co-Manager ‣ Owner of Fuse Developments, Inc. and CrossTrackr, Inc.
  • 3. Realtime with WebSockets What are WebSockets? WebSockets are a full-duplex, persistent connection from a client to a server over a single TCP Connection. Once the connection is established, it stays open until the client or server decide to close the connection. This makes web programming entirely event driven, not (just) user initiated. It is stateful, as a single running server is aware of all connections, allowing you to communicate with any number of them at any given time.
  • 4. Blah Blah Blah … Show me what I can do with this and I don’t mean chat.
  • 5. Realtime with WebSockets HTTP Architecture Request Response Half-Duplex Communication
  • 6. Realtime with WebSockets Short Polling Request Response Loop AJAX Request on client side and ask the server for an update 6
  • 7. Realtime with WebSockets Long Polling Request Response Send AJAX request to server, request loops on server until there is a
 response and then returns to client and processes starts over again.
  • 8. Realtime with WebSockets WebSockets Handshake (HTTP Upgrade) Bidirectional Messaging open and persistent connection On side closes channel connection closed
  • 9. Realtime with WebSockets WebSockets in ColdFusion ‣ Supported as of ColdFusion 10 ‣ Support over defined port 
 Defaults to 8575 ‣ Flash Fallback 
 Port 1243
 Defined in lib/neo-websocket.xml ‣ Set Max Data Size (1024 Kb) ‣ 100 Connection Limit on Standard
 * Unlimited in Enterprise ‣ Introduced in ColdFusion 11 ‣ No Connection Limits ‣ Proxy Support 
 Great when behind a firewall and easier when dealing with SSL and multiple domains ‣ SSL Support
 Browsers no longer allow for non-secure connections over secured connections ‣ Cluster Support
 * Enterprise Only
  • 10. Realtime with WebSockets Enable WebSockets in ColdFusion in “4 EASY STEPS” ‣ Enable in Admin ‣ Add 1 Line in your Application.cfc ‣ Use the cfwebsocket tag ‣ Write some JavaScript and get creative
  • 12. Realtime with WebSockets ColdFusion 11 Admin Using Proxy Standard Enterprise
  • 13. DEMO 01 4 easy steps and a little bit more …
  • 14. Realtime with WebSockets Secure WebSockets - WSS ‣ Easiest Method, use Proxy. It relies on the SSL certificates defined for the site. Requires … ‣ IIS8+ with WebSocket Protocol Enabled ‣ Apache 2.2+ compiled with worker module not prefork (Apache MPM Worker) ‣ Using Built in WebSocket Server ‣ Create JKS (Java KeyStore) or PKCS12 file. ‣ JVM Setting (Fixes SSLException Error) 
 -Dcom.sun.net.ssl.enableECC=false ‣ If using self-assigned certificate ‣ Add certificate as a trusted certificate in Java keystore
 * this will fix issues with cfhttp calls as well - the following might as well
 -Dsun.security.ssl.allowUnsafeRenegotiation=true -Djsse.enableSNIExtension=false ‣ Trust the certificate using your browser
  • 15. Realtime with WebSockets Secure WebSockets - WSS - Server Requirements
  • 16. Realtime with WebSockets Secure WebSockets - WSS - Proxy w/ IIS
  • 17. DEMO 02 What do you mean it does not work?
  • 18. Realtime with WebSockets WebSocket Clusters Instance A Client A Client B Instance B Client C Client D
  • 19. Realtime with WebSockets WebSockets Clusters ▸ Must use built in WebSocket Server ▸ Create Instances in Instance Manager ▸ Define Cluster ▸ Rebuild Connections ▸ Turn on WebSocket clustering on all instances ▸ Have fun testing ….
  • 20. Realtime with WebSockets Real World Uses ‣ Dashboards (Stocks, Airlines, …) ‣ Auctions Sites ‣ Chat ‣ Push Messaging (email, notifications, etc) ‣ Games ‣ Use your imagination … anything is possible
  • 21. Real World Issues!!! Me and every other Developer ‣ Network Connections ‣ Application Reloads ‣ Server Uptime
  • 22. Realtime with WebSockets Hello AdvancedSocket ‣ Easily integrates with cfwebsocket ‣ Callbacks for connection drops that easily lets you add notifications to for users ‣ Application Reinit ‣ Server Downtime ‣ Network Connection ‣ Automatically reconnect to subscribed channels
  • 23. DEMO 03 Wait, they gave me something kind of broken?
  • 24. DEMO 04 Ok show me how easy it is to build an app … Now we chat
  • 25. DEMO 05 I don’t meet the requirements. What can I do?
  • 26. Realtime with WebSockets Helpful Links ‣ Repos ‣ https://github.com/GiancarloGomez/Realtime-With-WebSockets-Demo-Code ‣ https://github.com/GiancarloGomez/AdvancedSocket ‣ https://github.com/GiancarloGomez/ColdFusion-CFSummit-WebSockets ‣ SSL Related Links ‣ https://blog.httpwatch.com/2013/12/12/five-tips-for-using-self-signed-ssl-certificates-with-ios/ ‣ https://info.ssl.com/how-to-create-a-pfx-p12-certificate-file-using-openssl/ ‣ ColdFusion Articles ‣ http://www.adobe.com/devnet/coldfusion/articles/html5-websockets-coldfusion-pt1.html ‣ http://www.adobe.com/devnet/coldfusion/articles/html5-websockets-coldfusion-pt2.html ‣ http://www.adobe.com/devnet/coldfusion/articles/using-websocket.html ‣ https://helpx.adobe.com/coldfusion/developing-applications/coldfusion-and-html-5/using-coldfusion-websocket/websocket-enhancements.html ‣ WebSockets (Server / Services) ‣ http://socket.io/ ‣ https://www.pubnub.com/ ‣ https://pusher.com/
  • 28. Q & A