golang websocket 403错误

var __upgrader = websocket.Upgrader { ReadBufferSize:1024, WriteBufferSize: 1024, // 新增如下代码,解决跨域问题,即403错误 CheckOrigin: func(r *http.Request) bool { return true }, }

    推荐阅读