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

v5 response does not implement http.Hijacker #915

Closed
bohrasankalp opened this issue May 22, 2024 · 2 comments
Closed

v5 response does not implement http.Hijacker #915

bohrasankalp opened this issue May 22, 2024 · 2 comments

Comments

@bohrasankalp
Copy link

I am using v5 version, and trying to implement websocket. I am getting websocket: response does not implement http.Hijacker. I know from some closed issue it got fixed earlier. Is it done for v5 version as well.

My snippet
socket, err := upgrader.Upgrade(w, r, nil) if err != nil { return nil, err }

@VojtechVitek
Copy link
Contributor

Hi,

Nothing changed in chi from v4 to v5 in this regard. Hijacker should be available for HTTP 1, see https://github.com/go-chi/chi/blob/master/middleware/wrap_writer.go#L26.

Is it possible that you have some other middleware down the chain that wraps ResponseWriter and doesn't implement Hijacker?

@bohrasankalp
Copy link
Author

Thanks it because of one of the external middleware. I would fix it.

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