koding / websocketproxy

WebSocket reverse proxy handler for Go
http://godoc.org/github.com/koding/websocketproxy
MIT License
427 stars 120 forks source link

Error when copying from client to backend: websocket: close 1006 (abnormal closure): unexpected EOF #39

Open Haomeng opened 3 years ago

Haomeng commented 3 years ago

I just encountered below error message, looks like the wss connection is closed after dial successfully:

2020/10/19 17:25:43 websocketproxy: Error when copying from client to backend: websocket: close 1006 (abnormal closure): unexpected EOF 2020/10/19 17:25:43 http: response.WriteHeader on hijacked connection from huayun.com/haihe/bare-metal-vnc/src/websocketproxy.(*WebsocketProxy).ServeHTTP.func1 (websocket_proxy.go:130)

Note: connBackend, resp, err := dialer.Dial(backend.Url.String(), requestHeader) This line works fine, err is nil.

So any ideas, thans a lot!

alfrye commented 3 years ago

I am experiencing the same issues. Are there any updates on this issue?

feiyiban commented 2 years ago

I am experiencing the same issues. Are there any updates on this issue?

mpisat commented 2 years ago

Same here...

Egr711 commented 10 months ago

In my case, needed to copy response headers after dialing.

        # websocketproxy.go
        connBackend, resp, err := dialer.Dial(backendURL.String(), requestHeader)
    if err = wsCopyResponse(resp, respBackend); err != nil {
        errorF(w.option.logger, "websocketproxy: couldn't copy response: %v", err)
    }