-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[question] why are 'Sec-WebSocket-Extensions' headers not supported by upgrader. #540
Comments
As noted in the OP I moved this over from the original issue to keep that issue on task. To answer the question itself; I believe (after a bit of reading) that this is really just related to the included (experimental) implementation of RFC7692. To that end have a look at https://godoc.org/github.com/gorilla/websocket#hdr-Compression_EXPERIMENTAL |
@elithrar This issue has been resolved and can be closed. |
@nhooyr may I know in which version has been solved? conn, err := upgrader.Upgrade(w, r, r.Header)
|
So this |
stop passing thanks for the reference link. I can see
so not sure when you said
This is what I get as a response and the request on the browser. if I pass btw, I'm using the gorilla chat example for the client-side exactly and no changes on its js code. on the other hand on the server, I'm not sending any custom or manual header as a response to the client's request. So to avoid this error in order to just get the result I can validate the origin manually which I don't this this is the production level / proper solution! var Upgrader = websocket.Upgrader{
ReadBufferSize: 1024,
WriteBufferSize: 1024,
CheckOrigin: func(r *http.Request) bool {
if r.Header.Get("Origin") == "http://localhost:9090" { // <=====
return true
}
return false
},
} May I ask what is proper / production level the solution? Also, in the example, I can see they pass func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*Conn, error) |
I think you're confused on what responseHeader is for. Please see the docs on |
I misunderstood your original question @marti1125, now that I understand you were asking a related but still slightly separate question I've created a new issue for this using the 'reference in new issue' function.
Original comment is as follows:
I am trying to understand subprotocols using client/server example
I just modify https://github.com/gorilla/websocket/blob/master/examples/echo/server.go#L23
c, err := upgrader.Upgrade(w, r, r.Header)
in the terminal show
upgrade:websocket: application specific 'Sec-WebSocket-Extensions' headers are unsupported
Originally posted by @marti1125 in #404 (comment)
The text was updated successfully, but these errors were encountered: