Skip to content

Commit

Permalink
optimize: improve chat example (#12)
Browse files Browse the repository at this point in the history
* optimize: improve chat example

* chore: revert

* chore: revert
  • Loading branch information
L2ncE committed Feb 2, 2023
1 parent b50c6ca commit b7b0e0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/chat/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
};

if (window["WebSocket"]) {
conn = new WebSocket("ws://" + document.location.host + "/ws");
conn = new WebSocket("ws://localhost:8080/ws");
conn.onclose = function (evt) {
var item = document.createElement("div");
item.innerHTML = "<b>Connection closed.</b>";
Expand Down
3 changes: 3 additions & 0 deletions examples/chat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import (
var upgrader = websocket.HertzUpgrader{
ReadBufferSize: 1024,
WriteBufferSize: 1024,
CheckOrigin: func(ctx *app.RequestContext) bool {
return true
},
}

var addr = ":8080"
Expand Down

0 comments on commit b7b0e0f

Please sign in to comment.