labstack / echox

Echo cookbook and website
https://echo.labstack.com
MIT License
408 stars 285 forks source link

Websocket Example: Error for checkOrigin #183

Closed kmahyyg closed 1 year ago

kmahyyg commented 3 years ago

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 },
    }
)