add a cowboy connection function to upgrade the connection to a websocket