go.talks/present: make js use correct websocket address
This makes the client connect to the host from which it's being served,
rather than being hardcoded to localhost:3999.
Right now, if you try to run with -http set to any port other than
3999, you'll get websocket closed as soon as you open the presentation.
R=golang-dev
CC=adg, golang-dev
https://golang.org/cl/7829046
diff --git a/present/js/play.js b/present/js/play.js
index d4540dc..91743e3 100644
--- a/present/js/play.js
+++ b/present/js/play.js
@@ -40,7 +40,7 @@
stopFunc();
}
}
-
+
function onRun() {
onKill();
outpre.innerHTML = "";
@@ -97,7 +97,7 @@
}
if (play.length > 0) {
if (window.connectPlayground) {
- runFunc = window.connectPlayground("ws://localhost:3999/socket");
+ runFunc = window.connectPlayground("ws://" + window.location.host + "/socket");
} else {
// If this message is logged,
// we have neglected to include socket.js or playground.js.