[fix] Set the secure flag when the protocol in the connection URL is `wss:`