sockjs support

This is a squashed version of #14