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

otelmux middleware doesn't support websockets #5402

Open
koschos opened this issue Apr 18, 2024 · 0 comments
Open

otelmux middleware doesn't support websockets #5402

koschos opened this issue Apr 18, 2024 · 0 comments
Labels
area: instrumentation Related to an instrumentation package bug Something isn't working good first issue Good for newcomers instrumentation: otelmux

Comments

@koschos
Copy link

koschos commented Apr 18, 2024

Description

otelmux middleware doesn't support websockets.

Environment

  • OS: [all]
  • Architecture: [all]
  • Go Version: [all]
  • otelmux version: [all]

Steps To Reproduce

  1. Use this middleware with websockets
  2. Run ...
  3. See error Unexpected error upgrading connection, error type assertion failed ResponseWriter not a Hijacker

Expected behavior

Middleware supports websockets

The method below must be added in the file mux.go

func (h *recordingResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
	if hijacker, ok := h.writer.(http.Hijacker); ok {
		return hijacker.Hijack()
	}
	return nil, nil, fmt.Errorf("underlying ResponseWriter does not support hijacking")
}
@koschos koschos added area: instrumentation Related to an instrumentation package bug Something isn't working instrumentation: otelmux labels Apr 18, 2024
@dmathieu dmathieu added the good first issue Good for newcomers label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: instrumentation Related to an instrumentation package bug Something isn't working good first issue Good for newcomers instrumentation: otelmux
Projects
None yet
Development

No branches or pull requests

2 participants