Skip to content

Latest commit

 

History

History
33 lines (20 loc) · 818 Bytes

README.md

File metadata and controls

33 lines (20 loc) · 818 Bytes

Centrifuge client for browser

This is playground based on https://github.com/centrifugal/centrifuge-js

Install and quick start

Just download and include centrifuge.js into your web page using script tag:

<script src="centrifuge.js"></script>

Create new Centrifuge object instance, subscribe on channel and call .connect() method to make actual connection to server:

var
centrifuge = new myCentrifuge('ws://centrifuge.example.com/connection/websocket');

centrifuge.subscribe('news', function( msg ) {

  console.log( msg );

});

centrifuge.connect();

Check original documentation if needed.

Just receive messages from Centrifuge server

You can do this with vanilla js (no centrifuge.js needed): https://github.com/datalog/centrifuge-js/blob/master/cfugolight.js