Socket cluster implementation for Vuejs 2 leveraging uws
Install
npm install vue-socket-cluster-client --save
Usage
Configuration
;Vue
Add to the Vuejs instance
add a property CONNECTION_NAME+Events
to listen to connection events
var vm =CONNECTION_NAMEEvents:{console}{console}// ['error','connect','disconnect','connectAbort','connecting', etc ...] See socket cluster docs{//An error occurred on the connection name echo}{}// ...// for hyphen separated events such as 'custom-error' use ...{}methods://triggerInstance object = ```connection_name+Client```{this$CONNECTION_NAMEClient;}
Remove existing listener on client
delete this$options$CONNECTION_NAMEClientevent_name;
Browser compatibility:
- Firefox
- Chrome
- Edge
- IE 11+ (not tested on below previous versions)
- Safari
- Others (not tested)
Based on works from nigeltiany/vue-socket-cluster and its contributors This module differs from vue-socket-cluster in that it does not only allows you to add the socket cluster client to the vue instance.