socket-class.js
now emits 'socket' on socket listening state
added stop method to stop socket listening manually. (no remote access via base yet)
added .name and .id to consumer from either packet props or packet data prop
consumer.js
don't allow passed options mutation
add .name prop
merge in passed data option prop into authentication packet sent to socket
socket:
removed all 'client' names and replaced with 'consumer'
switched to using MAP for holding consumers
incoming consumer includes passing opts.data for passing consumer specific information to socket
consumer:
supports opts.data for passing to socket
updated examples accordingly
add online/offline/pause/resume to json stream
removed bad 'connection' emits from socket-class as that event is already used by actual consumer connections.
register authenticator added to consumer and socket
default consumer authenticator looks for token in environment or opts or sets to 'default'
default socket authenticator looks for token validator method
add and remove token methods
default token validator method just checks sent token against list
can register alt token validator
improved authenticate function to handle fail reason and anonymous connect