now dynamically switching websocket endpoint based on connection method (fixes #15)