SlideShare a Scribd company logo
1
La Storia di SignalR
Dalla nascita alla ri-nascita
AzureConference
1
2
I creatori
David Fowler Damian Edwards
SignalR nacque nel 2011
Socket.io, release (0.1.0), il 19/03/2010
3
La storia in ASP .NET
Fu portato nel progetto ASP.NET nel 2013.
In quell’anno WebSocket era un protocollo, appena
standardizzato, ma che molti browser non conoscevano.
Si utilizzavano tecnichiche come polling e altre tecniche
come il Server-Side Event non erano ancora
completamente implementate dai browser.
SignalR nacque per risolvere il problema e inserire un
supporto all’interno dello stack ASP .NET. SignalR divenne
una libreria di riferimento per il RealTime.
4
La storia in ASP .NET
SignalR quindi si fa carico di negoziare il miglior
protocollo di trasporto disponibile per la comunicazione.
SignalR, alla nascita, era strettamente accoppiato a jQuery.
Il web di allora lo era quasi interamente.
Altre funzionalità native dello strumento:
• Riconnessione automatica
• Scalabilità chiavi in mano (Service-Bus)
5
La rinascita
6
La rinascita
Nel 2018 viene interamente riscritto.
Nessuna dipendenza con la libreria jQuery.
Scalabilità (Redis – Azure SignalR Service)
Cross-platform
Estendibile
Disponibile dalla versione ASP .NET Core 2.1
Client: Javascript – Typescript – .NET - Node.js - Python
Prossime release: Java e C++
Planning: Go, PHP
7
I pacchetti disponibili per ASP .NET Signlar
ASP .NET:
https://www.nuget.org/packages/Microsoft.AspNet.SignalR/
JavaScript:
https://www.nuget.org/packages/Microsoft.AspNet.SignalR.JS/
C++: https://github.com/SignalR/SignalR-Client-Cpp
NodeJS: None
PHP: None
Go: None
Python: https://pypi.org/project/signalr-client/
Java: https://github.com/SignalR/java-client
8
I pacchetti disponibili per ASP .NET Core Signalr
ASP .NET Core: 'Microsoft.AspNetCore.SignalR.Client' on NuGet
(https://www.nuget.org/packages/Microsoft.AspNetCore.SignalR/)
Java: 'com.microsoft.aspnet:signalr' on Maven
(https://search.maven.org/artifact/com.microsoft.aspnet/signalr)
JavaScript (including NodeJS): '@aspnet/signalr' on NPM
(https://www.npmjs.com/package/@aspnet/signalr)
C++: (Prototype) https://github.com/aspnet/SignalR/tree/master/clients/cpp
(no official release planned yet)
Swift: (Unofficial) SwiftSignalRClient on CocoaPods
(https://github.com/moozzyk/SignalR-Client-Swift)
PHP ?
Go: Planning
Python: Planning
https://github.com/aspnet/SignalR/tree/release/2.2/specs Per contribuire
9
Protocolli di trasporto
Browser supportati, scenari legacy
AzureConference
9
“A transport is required to have
the following attributes:
Duplex
Binary-safe
Text-safe
14
SignalR
The only transport which fully implements the duplex
requirement is WebSockets
The others are "half-transports" which implement one end of
the duplex connection.
They are used in combination to achieve a duplex connection.
15
SignalR
ASP.NET Core SignalR was built to be a general purpose
RPC(remote procedure call) based communication library.
It supports:
• Multicast
• Broadcast
• Groups
• Bidirectional RPC
• Streaming
16
Server-Sent Events
17
Web Socket
18
Web Socket
19
Forever frame
20
Protocolli di messaggio
Json, msgpack, custom
AzureConference
20
21
JSON
22
JSON
{
"arguments":[
{
"To":{
"Username":"demo",
"ConnectionId":"cqvsDNFlhjht7c6-NyWgvQ"
},
"From":{
"Username":"andrea.tosato",
"ConnectionId":"JLn11llArunDqCMmVqFrbg"
},
"TextMessage":"Buongiorno e benvenuto"
}
],
"target":"AddPrivateMessage",
"type":1
}
23
MessagePack
https://msgpack.org/
24
Message Pack vs Json
25
MessagePack
Microsoft.AspNetCore.SignalR.Protocols.MessagePack
Client
@aspnet/signalr-protocol-msgpack
<script src="~/lib/signalr/signalr.js"></script>
<script src="~/lib/msgpack5/msgpack5.js"></script>
<script src="~/lib/signalr/signalr-protocol-msgpack.js"></script>
“If you want to implement a
custom message protocol,
ASP.NET Core SignalR has
extensibility points that allow
new protocols to be plugged in
Demo
Heart Rate
28
Connessione e trasferimento dati
Negoziazione della connessione, invio
e ricezione dati
AzureConference
28
29
Negotiate
{
"connectionId":"nw-Mk2QvXGxS5WyffMao4A",
"availableTransports":[
{
"transport":"WebSockets",
"transferFormats":["Text", "Binary"]
},
{
"transport":"ServerSentEvents",
"transferFormats":["Text"]
},
{
"transport":"LongPolling",
"transferFormats":["Text", "Binary"]
}
]
}
30
Metodi di invio
SendAsync
Fire and forget
metodo da utilizzare nel server
InvokeAsyn
Metodo che assicura l’invio al client.
31
Streaming
ASP.NET Core SignalR supporta streaming valori restituiti
dei metodi del server.
Ciò è utile per scenari in cui verranno inviati frammenti di
dati nel corso del tempo.
Quando un valore restituito viene trasmesso al client, non
appena diventa disponibile, anziché attendere che tutti i dati
diventino disponibili.
32
Streaming – oggetti da utilizzare
ChannelReader<T>
Restituisce un valore non appena disponibile.
ChannelWriter<T>
Consente la scrittura di dati all’interno di uno stream.
Demo
Streaming
34
Streaming – Cooming soon
Server To Client (Work)
Client To Server (Cooming soon)
35
Scalare SignalR
Scenari On-Premise
AzureConference
35
36
Perchè Scalare?
Server A - IIS
WebApp
Client 1 Client 2 Client 3 Client N
37
Load Balancer
Perchè Scalare?
Server B - IIS
WebApp
Client 1 Client 2 Client 3 Client N
Server A - IIS
WebApp
38
Load Balancer
Perchè Scalare?
Server B - IIS
WebApp
Client 1 Client 2 Client 3 Client N
Server A - IIS
WebApp
Backplane
39
Backplane
Redis - Pub/Sub
https://redis.io/topics/pubsub
40
Backplane
Sticky Sessions
41
Backplane
Round Robin
Round Robin
with Sticky Session
Server A Server B Server A Server B
User 1 User 2 User 1 User 2
42
Backplane
services
.AddSignalR()
.AddRedis("ConnectionString");
Microsoft.AspNetCore.SignalR.Redis
43
Scalare SignalR
Scenari Cloud
AzureConference
43
44
Azure SignalR Services
SignalR è un servizio completamente gestito.
puoi implementarlo in un ambiente multiserver senza
preoccuparti di:
• hosting,
• scalabilità,
• bilanciamento del carico
• autenticazione.
45
Azure SignalR Services
More regions. SignalR Service is now available in the
following regions: US East, US East 2, US Central, US West, US
West 2, Canada East, West Europe, North Europe, Southeast
Asia, Australia East, and Japan East. And in the coming
months we will add more regions.
More reliability. The Azure SignalR Service GA offers 99.9%
availability with a service level agreement for production use.
More capacity. During its preview, the SignalR Service was
limited to 10K connections in the Standard Tier. With GA, it
increases to 100K connections per instance. Through
sharding or partitioning, users can configure multiple
instances to handle an even larger scale.
46
Azure SignalR Services – ASP .NET Core
1
2
3
47
API REST
SWAGGER
https://editor.swagger.io/
SWAGGER DOC
https://github.com/Azure/azure-
signalr/blob/dev/docs/swagger/v1.json
48
https://github.com/Azure/azure-signalr/blob/dev/docs/rest-api.md
API REST
Demo
Azure Signalr Service
50
Azure SignalR Service
ASP .NET SignalR versione 2.4
Supporto Azure SignalR per scalabilità chiavi in mano
Coming in 2019
51
Serverless
Serveless
AzureConference
51
52
Azure SignalR Services – Serverless
1
2
53
Grazie a una estensione per Azure Functions non è
necessario avere la parte server di SignalR su una
applicazione ASP .NET Core.
L’estensione ha grossi limiti, ma per alcuni sceri può essere
utile.
https://github.com/anthonychu/AzureAdvocates.WebJobs.Extensions.SignalRService OLD
Current limitations
•Only supports broadcasting at this time, cannot invoke methods on a subset of connections,
users, or groups
•Functions cannot be triggered by client invocation of server methods (clients need to call an
HTTP endpoint or post messages to a Event Grid, etc, to trigger a function)
https://github.com/Azure/azure-functions-signalrservice-extension NEW
https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.SignalRService
Azure SignalR Services – Serverless
54
Supported scenarios
•Allow clients to serverlessly connect to a SignalR Service hub
without requiring an ASP.NET Core backend
•Use Azure Functions (any language supported by V2) to broadcast
messages to all clients connected to a SignalR Service hub
Bindings
SignalRConnectionInfo input binding makes it easy to generate the
token required for clients to initiate a connection to Azure SignalR
Service.
SignalR output binding allows messages to be broadcast to an Azure
SignalR Service hub.
Azure SignalR Services – Serverless
Demo
Serverless - Desktop
56
Blazor - SignalR
https://blazor.net/community.html
https://blazorchatsample.azurewebsites.net/
https://github.com/conficient/BlazorChatSample
57
Esempio
Creare una chat completa
AzureConference
57
Demo
Chat
59
Codice demo
https://github.com/andreatosato/RealTime
https://dnsignalr.azurewebsites.net
60
Azure SignalR Service - il WebSocket che tanto ci mancava
ATosato86
andreatosato
andrea.tosato
CloudGen Verona
aspitalia.com
4ward
ANDREA TOSATO

More Related Content

PDF
Security Tips to run Docker in Production
PDF
Securing k8s With Kubernetes Goat
PDF
Docker kubernetes fundamental(pod_service)_190307
PDF
Nex clipper 1905_summary_eng
PDF
Cisco Cloud Networking Workshop
PDF
Simplifying and Securing your OpenShift Network with Project Calico
PPTX
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan
PPTX
Securing Kubernetes Clusters with NGINX Plus Ingress Controller & NAP
Security Tips to run Docker in Production
Securing k8s With Kubernetes Goat
Docker kubernetes fundamental(pod_service)_190307
Nex clipper 1905_summary_eng
Cisco Cloud Networking Workshop
Simplifying and Securing your OpenShift Network with Project Calico
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan
Securing Kubernetes Clusters with NGINX Plus Ingress Controller & NAP

What's hot (20)

PDF
Container Networking - State of the Ecosystem [ContainerConf, Mannheim, Nov 2...
PPTX
Communication Amongst Microservices: Kubernetes, Istio, and Spring Cloud - An...
PPTX
OpenStack and Kubernetes - A match made for Telco Heaven
PPTX
The missing piece : when Docker networking and services finally unleashes so...
PDF
VMware ESXi - Intel and Qlogic NIC throughput difference v0.6
PDF
Cisco Live 2017: Container networking deep dive with Docker Enterprise Editio...
PPTX
12 Factor App
PDF
Kubernetes for the PHP developer
PDF
Spring Cloud Kubernetes - Ryan Baxter
PDF
Cilium: Kernel Native Security & DDOS Mitigation for Microservices with BPF
PDF
A Hitchhiker's Guide to Enterprise Microservices with Go
PDF
Get the Most Out of Kubernetes with NGINX
PPTX
Hybrid Cloud and Hyper Cloud
PDF
Elevate Your Enterprise Python and R AI, ML Software Strategy with Anaconda T...
PPTX
Container Networking: the Gotchas (Mesos London Meetup 11 May 2016)
PPTX
Application Modernization with PKS / Kubernetes
PDF
Developing Realtime Data Pipelines With Apache Kafka
PPTX
Kubered -Recipes for C2 Operations on Kubernetes
PDF
Network Service Mesh
PDF
Putting microservices on a diet with Istio
Container Networking - State of the Ecosystem [ContainerConf, Mannheim, Nov 2...
Communication Amongst Microservices: Kubernetes, Istio, and Spring Cloud - An...
OpenStack and Kubernetes - A match made for Telco Heaven
The missing piece : when Docker networking and services finally unleashes so...
VMware ESXi - Intel and Qlogic NIC throughput difference v0.6
Cisco Live 2017: Container networking deep dive with Docker Enterprise Editio...
12 Factor App
Kubernetes for the PHP developer
Spring Cloud Kubernetes - Ryan Baxter
Cilium: Kernel Native Security & DDOS Mitigation for Microservices with BPF
A Hitchhiker's Guide to Enterprise Microservices with Go
Get the Most Out of Kubernetes with NGINX
Hybrid Cloud and Hyper Cloud
Elevate Your Enterprise Python and R AI, ML Software Strategy with Anaconda T...
Container Networking: the Gotchas (Mesos London Meetup 11 May 2016)
Application Modernization with PKS / Kubernetes
Developing Realtime Data Pipelines With Apache Kafka
Kubered -Recipes for C2 Operations on Kubernetes
Network Service Mesh
Putting microservices on a diet with Istio
Ad

Similar to Azure Signalr Service (20)

PDF
Azure SignalR Service, il web socket che tanto ci mancava
PPTX
Vijay Oscon
PPTX
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
PPTX
StrongLoop Overview
PDF
IoT Solution Design based on Azure and AWS
PPTX
Vijay Mix Presentation
PPTX
SUGCON EU 2023 - Secure Composable SaaS.pptx
PPTX
Teched India Vijay Interop Track
PPTX
Azure Service Fabric: The road ahead for microservices
PDF
Multi-Container Apps spanning Docker, Mesos and OpenStack
PPTX
.NET Core Today and Tomorrow
PPTX
Brk30176 enterprise class networking in azure
PDF
Red Hat and kubernetes: awesome stuff coming your way
PPTX
Web e device in real time con asp.net Signal R
PDF
The Future of Cloud Innovation, featuring Adrian Cockcroft
PDF
“Open Standards: Powering the Future of Embedded Vision,” a Presentation from...
PDF
Aplicaciones distribuidas con Dapr
PDF
FIWARE Wednesday Webinars - Short Term History within Smart Systems
PDF
Cloud-native .NET Microservices mit Kubernetes
PDF
Azure Containers & Serverless Technology Options (After-Tech-Summit-2018 Edit...
Azure SignalR Service, il web socket che tanto ci mancava
Vijay Oscon
Asynchrone Echtzeitanwendungen für SharePoint mit SignalR und knockout.js
StrongLoop Overview
IoT Solution Design based on Azure and AWS
Vijay Mix Presentation
SUGCON EU 2023 - Secure Composable SaaS.pptx
Teched India Vijay Interop Track
Azure Service Fabric: The road ahead for microservices
Multi-Container Apps spanning Docker, Mesos and OpenStack
.NET Core Today and Tomorrow
Brk30176 enterprise class networking in azure
Red Hat and kubernetes: awesome stuff coming your way
Web e device in real time con asp.net Signal R
The Future of Cloud Innovation, featuring Adrian Cockcroft
“Open Standards: Powering the Future of Embedded Vision,” a Presentation from...
Aplicaciones distribuidas con Dapr
FIWARE Wednesday Webinars - Short Term History within Smart Systems
Cloud-native .NET Microservices mit Kubernetes
Azure Containers & Serverless Technology Options (After-Tech-Summit-2018 Edit...
Ad

More from Andrea Tosato (20)

PPTX
Codemotion Azure Container Apps
PPTX
Lite db for dummies
PDF
Azure Static Web Apps & Blazor
PPTX
Dapr logicapps
PPTX
How to develop modern web application, with no money and nod javascript
PPTX
Entity framework core v3 from sql to no sql
PDF
How to develop modern web application - With no money and no Javascript
PDF
Mixing Identity server, AAD, ASP .NET Identity
PDF
An introduction to GraphQL in .NET Core
PDF
DevOps Heroes 2019
PPTX
dotNetConf2019
PPTX
Cost Optimization - Global Azure Bootcamp 2019
PPTX
Deep Dive Azure Functions - Global Azure Bootcamp 2019
PPTX
Azure Function Workflow
PPTX
Azure Cognitive Service on Container
PPTX
Deploy multi-environment application with Azure DevOps
PPTX
Azure Cognitive Service in Container
PPTX
Xamarin - Microcharts
PPTX
Introduzione Xamarin
PPTX
Unit Testing
Codemotion Azure Container Apps
Lite db for dummies
Azure Static Web Apps & Blazor
Dapr logicapps
How to develop modern web application, with no money and nod javascript
Entity framework core v3 from sql to no sql
How to develop modern web application - With no money and no Javascript
Mixing Identity server, AAD, ASP .NET Identity
An introduction to GraphQL in .NET Core
DevOps Heroes 2019
dotNetConf2019
Cost Optimization - Global Azure Bootcamp 2019
Deep Dive Azure Functions - Global Azure Bootcamp 2019
Azure Function Workflow
Azure Cognitive Service on Container
Deploy multi-environment application with Azure DevOps
Azure Cognitive Service in Container
Xamarin - Microcharts
Introduzione Xamarin
Unit Testing

Recently uploaded (20)

PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
System and Network Administraation Chapter 3
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
L1 - Introduction to python Backend.pptx
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
ai tools demonstartion for schools and inter college
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPT
Introduction Database Management System for Course Database
PDF
Nekopoi APK 2025 free lastest update
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
ISO 45001 Occupational Health and Safety Management System
PPTX
Introduction to Artificial Intelligence
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
top salesforce developer skills in 2025.pdf
PDF
Digital Strategies for Manufacturing Companies
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Odoo POS Development Services by CandidRoot Solutions
System and Network Administraation Chapter 3
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
L1 - Introduction to python Backend.pptx
Wondershare Filmora 15 Crack With Activation Key [2025
ai tools demonstartion for schools and inter college
How to Choose the Right IT Partner for Your Business in Malaysia
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Introduction Database Management System for Course Database
Nekopoi APK 2025 free lastest update
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Online Work Permit System for Fast Permit Processing
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
ISO 45001 Occupational Health and Safety Management System
Introduction to Artificial Intelligence
Operating system designcfffgfgggggggvggggggggg
top salesforce developer skills in 2025.pdf
Digital Strategies for Manufacturing Companies
CHAPTER 2 - PM Management and IT Context
Adobe Illustrator 28.6 Crack My Vision of Vector Design

Azure Signalr Service

Editor's Notes

  • #20: Forever Frame creates a hidden IFrame which makes a request to an endpoint on the server that does not complete. The server then continually sends script to the client which is immediately executed, providing a one-way realtime connection from server to client. The connection from client to server uses a separate connection from the server to client connection, and like a standard HTTP request, a new connection is created for each piece of data that needs to be sent.
  • #48: Crea JWT Token: http://jwtbuilder.jamiekurtz.com/ Port REST APIs are only exposed on port 5002. Authentication In each HTTP request, an authorization header with a JSON Web Token (JWT) is required to authenticate with Azure SignalR Service. Signing Algorithm and Signature HS256, namely HMAC-SHA256, is used as the signing algorithm. You should use the AccessKey in Azure SignalR Service instance's connection string to sign the generated JWT token. Claims aud (audience) and exp(expiration time) are required claims in the JWT token. The aud claim should be exactly the same as your HTTP request url, trailing slash and query paramters not included. For example, a broadcast request's audience should look like as below: https://example.service.signalr.net:5002/api/v1-preview/hub/myhub Esempio: https://github.com/aspnet/AzureSignalR-samples/tree/master/samples/Serverless
  • #49: Crea JWT Token: http://jwtbuilder.jamiekurtz.com/ Port REST APIs are only exposed on port 5002. Authentication In each HTTP request, an authorization header with a JSON Web Token (JWT) is required to authenticate with Azure SignalR Service. Signing Algorithm and Signature HS256, namely HMAC-SHA256, is used as the signing algorithm. You should use the AccessKey in Azure SignalR Service instance's connection string to sign the generated JWT token. Claims aud (audience) and exp(expiration time) are required claims in the JWT token. The aud claim should be exactly the same as your HTTP request url, trailing slash and query paramters not included. For example, a broadcast request's audience should look like as below: https://example.service.signalr.net:5002/api/v1-preview/hub/myhub Esempio: https://github.com/aspnet/AzureSignalR-samples/tree/master/samples/Serverless
  • #50: Portale Scalabilita (Up – Out) ASP .NET Core Secret Startup progetto
  • #51: Portale Scalabilita (Up – Out) ASP .NET Core Secret Startup progetto