Skip to content

Commit

Permalink
Using current host for socket connection #7
Browse files Browse the repository at this point in the history
Signed-off-by: BugDiver <vinaysh@thoughtworks.com>
  • Loading branch information
BugDiver committed Jun 3, 2020
1 parent 53de40f commit 64942f5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion listener/html.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var html = `
};
const initWS = () => {
const socket = new WebSocket("ws://{{ .URL }}");
const socket = new WebSocket("ws://" + window.location.host + "/progress");
socket.onopen = () => console.log("Socket opened");
socket.onmessage = function(e) {
const data = JSON.parse(e.data);
Expand Down
2 changes: 0 additions & 2 deletions listener/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@ var timestamp = time.Now().Format("2006-01-02 15:04:05")

func home(w http.ResponseWriter, r *http.Request) {
data := struct {
URL string
Project string
Timestamp string
}{
URL: fmt.Sprintf("127.0.0.1:%d/progress", port),
Project: GetProjectRoot(),
Timestamp: timestamp,
}
Expand Down

0 comments on commit 64942f5

Please sign in to comment.