use window.location.hostname in dev client - fixes #165

This commit is contained in:
Rich Harris
2018-03-10 10:26:00 -05:00
parent e8f3aff0da
commit 61000a4795

View File

@@ -11,7 +11,7 @@ function check() {
export function connect(port) {
if (source || !window.EventSource) return;
source = new EventSource(`http://localhost:${port}/__sapper__`);
source = new EventSource(`http://${window.location.hostname}:${port}/__sapper__`);
window.source = source;