Made a mistake. Should be Url.parse(url).protocol