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

Support for overriding ErrorHandler in httputil.ReverseProxy #1234

Closed
kayvonkhosrowpour opened this issue Jun 22, 2022 · 1 comment
Closed

Comments

@kayvonkhosrowpour
Copy link

What would you like?

Motivation
I am using the https://pkg.go.dev/github.com/go-kit/kit/transport/httprp package for a reverse proxy. If the client disconnects or the connection is dropped, an error is produced in our logs:

http: proxy error: context canceled

Digging into the go-kit source code, the httputil.ReverseProxy is created but it's not possible to set the ErrorHandler function, which is responsible for logging the above error message. This clutters our logs and doesn't let us control how errors are handled in our application.

See more here: golang/go#20071

Proposal
To follow along with the ServerOption abstraction, perhaps a new option can be added which can allow users to override the default ErrorHandler.

@peterbourgon
Copy link
Member

The httprp.Server is tiny, and in truth was only meant as a kind of tech demo. I don't think it makes sense to add capabilities to it. Better for you to copy/paste it to your own repo.

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