mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Added access control header *
This commit is contained in:
parent
bacee6570d
commit
8c406982f3
@ -15,6 +15,7 @@ var wsupgrader = websocket.Upgrader{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func wshandler(w http.ResponseWriter, r *http.Request) {
|
func wshandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
conn, err := wsupgrader.Upgrade(w, r, nil)
|
conn, err := wsupgrader.Upgrade(w, r, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed to set websocket upgrade: %+v", err)
|
fmt.Println("Failed to set websocket upgrade: %+v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user