aspnetcore/client-ts/signalr-protocol-msgpack
Andrew Stanton-Nurse bc6ed02b6e
fix the umd build of msgpack (#1600)
2018-03-14 13:40:27 -07:00
..
spec Remove support for binary over SSE and add transfer format to negotiation (#1564) 2018-03-13 14:29:32 -07:00
src Remove support for binary over SSE and add transfer format to negotiation (#1564) 2018-03-13 14:29:32 -07:00
README.md
package-lock.json fix package-lock.json files (#1592) 2018-03-13 18:55:56 -07:00
package.json Remove support for binary over SSE and add transfer format to negotiation (#1564) 2018-03-13 14:29:32 -07:00
rollup.config.js fix the umd build of msgpack (#1600) 2018-03-14 13:40:27 -07:00
tsconfig.json

README.md

MsgPack support for SignalR for ASP.NET Core

Installation

npm install @aspnet/signalr-protocol-msgpack

Usage

Browser

To use the client in a browser, copy *.js files from the dist/browser folder to your script folder include on your page using the <script> tag.

Example (Browser)

let connection = new signalR.HubConnection('/chat', {
    protocol: new signalR.protocols.msgpack.MessagePackHubProtocol()
});

connection.on('send', data => {
    console.log(data);
});

connection.start()
    .then(() => connection.invoke('send', 'Hello'));

Example (NodeJS)

const signalR = require("@aspnet/signalr");
const signalRMsgPack = require("@aspnet/signalr-protocol-msgpack");

let connection = new signalR.HubConnection('/chat', {
    protocol: new signalRMsgPack.MessagePackHubProtocol()
});

connection.on('send', data => {
    console.log(data);
});

connection.start()
    .then(() => connection.invoke('send', 'Hello'));