make websocket try to use HTTPS if connecting fails

This fixes connecting when behind transparent proxies that break
WebSockets.