SlideShare a Scribd company logo
18 NOVEMBRE
2016
Come ti "pusho" il web con
WebSockets:
da 0 a SignalRAlessandro Melchiori / @amelchiori
Come ti "pusho" il web con WebSockets: da 0 a SignalR
Web.vNext()
• Today’s applications demand real-time, low-latency
messaging
• Users expect to be able to interact with data as close
to real-time as possible
• No needs to hit refresh button
Periodic Polling
Polling an endpoint at a given interval and returning
data when it is available
Long polling
The server/endpoint holds on to the HTTP request until there is
data/payload available and then returns to the client. The client then
follows up with another request and waits until new data or
event/payload is available.
The WebSocket protocol
The WebSocket Protocol enables two-way communication between a client running untrusted code
in a controlled environment to a remote host that has opted-in to communications from that code.
The security model used for this is the origin-based security model commonly used by web
browsers. The protocol consists of an opening handshake followed by basic message framing,
layered over TCP. The goal of this technology is to provide a mechanism for browser-based
applications that need two-way communication with servers that does not rely on opening multiple
HTTP connections (e.g., using XMLHttpRequest or <iframe>s and long polling).
https://tools.ietf.org/html/rfc6455
The WebSocket protocol
The WebSocket Protocol enables two-way communication between a client running untrusted code
in a controlled environment to a remote host that has opted-in to communications from that code.
The security model used for this is the origin-based security model commonly used by web
browsers. The protocol consists of an opening handshake followed by basic message framing,
layered over TCP. The goal of this technology is to provide a mechanism for browser-based
applications that need two-way communication with servers that does not rely on opening multiple
HTTP connections (e.g., using XMLHttpRequest or <iframe>s and long polling).
https://tools.ietf.org/html/rfc6455
WebSocket: how it works
• Client and server establish initial handshake over HTTP/S
• Client request upgrades
• Server accepts upgrade request and establish socket connection
• Client and/or server send messages
DEMO
Welcome SignalR
• SignalR is a library that allows bi-directional communication between
server and client.
• SignalR supports Web Sockets, and falls back to other compatible
techniques for older browsers.
• SignalR includes APIs for connection management (for instance,
connect and disconnect events), grouping connections, and
authorization.
SignalR architecture
message cache
publisher
client client client client client
messagebus
-serializzazione
-salvataggioincache
-“deliverable”
-selezioneworker
-recuperomessaggio
notificaalclient(specific
transport)
DEMOInstall-Package Microsoft.AspNet.SignalR
Backend
Backend
SignalR: real scenario
FrontEnd
RabbitMQ
Backend
MSG
HTTP
MSG
MSGMSG
WS
DEMO
FrontEnd
FrontEnd
SignalR: scale-out
Backend
Backend
FrontEnd
RabbitMQ
Backend
MSG
HTTP
MSG
MSGMSG
WS
SignalR: scale-out
• How do messages from one server get to the other
servers in my web farm?
SignalR: scale-out
web nodes
clients
backplane
DEMO
SignalR: asp.net core?
• Open source: https://github.com/aspnet/SignalR
• Completely rewritten
• Client package -> typescript
• Full integration with asp.net core IoC
SignalR: asp.net core?
•Configure nuget to load preview package
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="AspNetCore" value="https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
Grazie!
Contatti:
• https://twitter.com/amelchiori
• http://melkio.codiceplastico.com
• alessandro@codiceplastico.com
Thank you! Questions?
https://twitter.com/ugidotnet

More Related Content

PDF
WT - Firewall & Proxy Server
PPTX
Web proxy server
PPT
Web Proxy Server
PPTX
Transport Layer Security (TLS)
PDF
Web application & proxy server
PPT
Introduction to stable proxies.
PPT
Mule anypointenterprisesecurity
PPSX
Web application security
WT - Firewall & Proxy Server
Web proxy server
Web Proxy Server
Transport Layer Security (TLS)
Web application & proxy server
Introduction to stable proxies.
Mule anypointenterprisesecurity
Web application security

What's hot (20)

PDF
Web Security
PPTX
PKI & SSL
DOC
PDF
Lecture #22 : Web Privacy & Security Breach
PDF
Firewall traversals
PPTX
Selecting cryptographic technique in peer to peer to Systems
PDF
Lecture #21: HTTPS , SSL & TLS
PPTX
Web Security and SSL - Secure Socket Layer
PPTX
web security
PDF
15 intro to ssl certificate &amp; pki concept
PPT
Web Security in Network Security NS7
PPTX
Data security in online commerce
PDF
I Http Module Leveraging
DOCX
S/MIME
PPTX
Decentralised comms Meetup - The dawn
PDF
Service Mesh vs. Frameworks: Where to put the resilience?
PPTX
Fundamental of Webserver Hacking, Web Applications and Database Attacks
PDF
SSL Secure socket layer
PPTX
Secure Socket Layer
PDF
RIA Cross Domain Policy
Web Security
PKI & SSL
Lecture #22 : Web Privacy & Security Breach
Firewall traversals
Selecting cryptographic technique in peer to peer to Systems
Lecture #21: HTTPS , SSL & TLS
Web Security and SSL - Secure Socket Layer
web security
15 intro to ssl certificate &amp; pki concept
Web Security in Network Security NS7
Data security in online commerce
I Http Module Leveraging
S/MIME
Decentralised comms Meetup - The dawn
Service Mesh vs. Frameworks: Where to put the resilience?
Fundamental of Webserver Hacking, Web Applications and Database Attacks
SSL Secure socket layer
Secure Socket Layer
RIA Cross Domain Policy
Ad

Similar to Come ti "pusho" il web con WebSockets: da 0 a SignalR (20)

PPTX
ClientServer Websocket.pptx
PPTX
Java Networking
PPTX
Http Vs Https .
PPTX
Real Time Web with SignalR
PDF
05 20254 financial stock application
PDF
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use Cases
PPTX
Web technology introduction to the web and its history
PPTX
PPTX
A web server is a software application or hardware device that stores, proces...
PDF
Subscription based control system to automate management of events for robots
PDF
CLO 4 Develop the network application using socket programming. To a.pdf
PPT
Unit 5 Application Layer
PDF
Protecting location privacy in sensor networks against a global eavesdropper
PDF
Protecting location privacy in sensor networks against a global eavesdropper
PPS
Introduction to WAP
PPTX
Www architecture,cgi, client server security, protection
PDF
Real time web apps
PPTX
CN UNIT V.pptx
PPTX
APIs at the Edge
PPTX
WebRTC
ClientServer Websocket.pptx
Java Networking
Http Vs Https .
Real Time Web with SignalR
05 20254 financial stock application
An In-Depth Comparison of WebSocket and SignalR: Pros, Cons, and Use Cases
Web technology introduction to the web and its history
A web server is a software application or hardware device that stores, proces...
Subscription based control system to automate management of events for robots
CLO 4 Develop the network application using socket programming. To a.pdf
Unit 5 Application Layer
Protecting location privacy in sensor networks against a global eavesdropper
Protecting location privacy in sensor networks against a global eavesdropper
Introduction to WAP
Www architecture,cgi, client server security, protection
Real time web apps
CN UNIT V.pptx
APIs at the Edge
WebRTC
Ad

More from Alessandro Melchiori (20)

PDF
C# metaprogramming with source generator.pdf
PDF
Scale your (aks) cluster, luke!
PDF
A quick introduction to AKS
PDF
Developing reliable applications with .net core and AKS
PDF
VS Code tools for docker
PPTX
Developing reliable applications with .net core and AKS
PDF
How to search...better! (azure search)
PDF
AKS: k8s e azure
PDF
How to search...better!
PPTX
A quick tour around Azure Dev Spaces
PPTX
Azure functions: from a function to a whole application in 60 minutes
PPTX
Aks: k8s e azure
PDF
Monitoring docker: from zero to Azure
PPTX
Cooking Akka.net and Azure Service Fabric together
PPTX
Azure data platform overview
PPTX
ACR + ACS + VSTS: a complete ALM pipeline with docker and azure
PPTX
Docker & Azure
PDF
Docker and Azure
PPTX
Docker &amp; azure
PPTX
Azure service fabric: a gentle introduction
C# metaprogramming with source generator.pdf
Scale your (aks) cluster, luke!
A quick introduction to AKS
Developing reliable applications with .net core and AKS
VS Code tools for docker
Developing reliable applications with .net core and AKS
How to search...better! (azure search)
AKS: k8s e azure
How to search...better!
A quick tour around Azure Dev Spaces
Azure functions: from a function to a whole application in 60 minutes
Aks: k8s e azure
Monitoring docker: from zero to Azure
Cooking Akka.net and Azure Service Fabric together
Azure data platform overview
ACR + ACS + VSTS: a complete ALM pipeline with docker and azure
Docker & Azure
Docker and Azure
Docker &amp; azure
Azure service fabric: a gentle introduction

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPT
Teaching material agriculture food technology
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
KodekX | Application Modernization Development
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Cloud computing and distributed systems.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Spectroscopy.pptx food analysis technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Spectral efficient network and resource selection model in 5G networks
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Teaching material agriculture food technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Diabetes mellitus diagnosis method based random forest with bat algorithm
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
NewMind AI Weekly Chronicles - August'25 Week I
KodekX | Application Modernization Development
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Cloud computing and distributed systems.
Dropbox Q2 2025 Financial Results & Investor Presentation
Unlocking AI with Model Context Protocol (MCP)
Spectroscopy.pptx food analysis technology
Encapsulation_ Review paper, used for researhc scholars
Understanding_Digital_Forensics_Presentation.pptx
Electronic commerce courselecture one. Pdf
Spectral efficient network and resource selection model in 5G networks

Come ti "pusho" il web con WebSockets: da 0 a SignalR