echox icon indicating copy to clipboard operation
echox copied to clipboard

Websocket Example: Error for checkOrigin

Open kmahyyg opened this issue 4 years ago • 0 comments

For: echox/website/content/cookbook/websocket.md

The example usage of Gorilla WS, will lead to a websocket origin not allowed error if you wanna use it to a websocket client.

I recommend:

var (
	upgrader = websocket.Upgrader{
		CheckOrigin: func(r *http.Request) bool { return true },
	}
)

kmahyyg avatar Feb 14 '21 07:02 kmahyyg