Get started with aspnet-signalr CDN

Apache-2.0 licensed

Asp.Net SignalR: library for real-time, bi-directional server-client communication.

  • signalr
  • websocket

Stable version


How to start using aspnet-signalr CDN

<!DOCTYPE html>
    <title>Get started with aspnet-signalr CDN -</title>
        /* Add any custom styles here */
    <script src=""></script>
    <script src=""></script>
        $(function () {
            // Create a new SignalR connection.
            var connection = new signalR.HubConnection('/signalr');

            // Start the connection.
            connection.start().done(function () {
                console.log('SignalR connection started.');

                // Receive messages from the server.
                connection.on('ReceiveMessage', function (message) {
                    $('#messagesList').append('<li><strong>' + + ':</strong> ' + message.message + '</li>');

                // Send a message to the server.
                $('#sendMessageButton').click(function () {
                    var name = $('#name').val();
                    var message = $('#message').val();
                    connection.send('SendMessage', name, message);
        <input id="name" type="text" placeholder="Your name" />
        <input id="message" type="text" placeholder="Your message" />
        <button id="sendMessageButton">Send</button>
    <ul id="messagesList"></ul>
    <script src="~/signalr/hubs"></script>

All versions