Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gorilla websocket error #104

Closed
olebedev opened this issue Aug 25, 2014 · 2 comments
Closed

gorilla websocket error #104

olebedev opened this issue Aug 25, 2014 · 2 comments

Comments

@olebedev
Copy link

I am trying to use gin with gorilla/websocket:

func ServeSocket(c *gin.Context) {
    conn, err := websocket.Upgrade(c.Writer, c.Request, nil, 1024, 1024)
    if err != nil {
        http.Error(w, "Websocket error", 400)
        fmt.Println(err)
        return
    }
}

But I am getting an error: websocket: response does not implement http.Hijacker.

As I see, there is no Hijack method on c.Writer, maybe it should be added? Or please tell my how can I use it without changing gin code. Thanks.

@Thomasdezeeuw
Copy link

Dup of #51

@olebedev
Copy link
Author

This #105 is my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants