JSFiddle - React, Tailwind, and code Playground
JavaScript
url = new URL("ftps://mydomain.com:22");
console.log('host:' + url.hostname + ' port:' + url.port);
url = new URL("https://mydomain.com:22");
console.log('host:' + url.hostname + ' port:' + url.port);