#463 changes to support better secure socket.io