Event handler for SockJS