switch default ws_url logic to js side

In some cases (proxies, #3305), the request object doesn't have the right information about the originating information.  This changes the default behavior, so that `ws_url` is generally empty by default, which the javascript takes to mean 'the same as http'.  This is simpler and should be more resilient than trying a guess on server-side.
replace unused websocket_host with websocket_url

Rather than specifying only the hostname, it makes much more sense
to specify the whole protocol,host,port in a single go.
Merge pull request #3307 from minrk/wsproto

switch default ws_url logic to js side

In some cases (proxies, #3305), the request object doesn't have the right information about the originating information. This changes the default behavior, so that ws_url is generally empty by default, which the javascript takes to mean 'the same as http'. This is simpler and should be more resilient than trying a guess on server-side.

also replaces unused websocket_host with websocket_url

Rather than specifying only the hostname, it makes much more sense to specify the whole protocol,host,port in a single go.
Modify CM margin (to rever later)

Fixes #3397, should also be reverted when closed by #3391
Cf #3358 also