Use wss scheme when accessing with https protocol

Hi,

Currently the websocket connection is only being established using
the ws scheme.
Adding support for wss scheme when using https protocol to allow
ssl connection.