use window.location.hostname to connect