Skip to content

Commit

Permalink
fix: ws connection url
Browse files Browse the repository at this point in the history
  • Loading branch information
harisheoran committed Dec 4, 2024
1 parent bd49f6e commit 5e6ef53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions chat-server/cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ var (
upgrader = websocket.Upgrader{
ReadBufferSize: 1024,
WriteBufferSize: 1024,
/*CheckOrigin: func(r *http.Request) bool {
// Allow all origins (not secure, only for testing)
return true
},*/
CheckOrigin: func(r *http.Request) bool {
// Allow all origins (not secure, only for testing)
return true
},
}

myChannel = "common-room"
Expand Down
4 changes: 3 additions & 1 deletion chat-server/ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
};

if (window["WebSocket"]) {
conn = new WebSocket("ws://0.0.0.0:1316/v1/chat");
conn = new WebSocket(
"ws://chat.harisheoran.xyz:1316/v1/chat",
);
conn.onclose = function (evt) {
var item = document.createElement("div");
item.innerHTML = "<b>Connection closed.</b>";
Expand Down

0 comments on commit 5e6ef53

Please sign in to comment.