Builds the websocket connection URL. Handles both production URLs (with protocol) and development hostnames.