Skip to content

net/http/httputil: ReverseProxy: time out long-idle upgraded connections #75830

@neild

Description

@neild

ReverseProxy automatically handles upgraded connections, such as WebSocket connections. When a proxied request results in a 101 Switching Protocols response, ReverseProxy switches to proxying raw bytes through the connection.

We should perhaps have some form of idleness detection, so a dead connection isn't left around consuming resources indefinitely. Currently, if one half of the connection vanishes without closing the TCP connection, ReverseProxy will leave the connection active until the OS times out the connection.

This probably needs to be off by default, since I'm certain someone is depending on ReverseProxy proxying long-lived but mostly-idle connections.

Since this will need to be configurable, it'll need to go through the proposal process once there's a concrete design for the configuration knob.

Metadata

Metadata

Assignees

No one assigned

    Labels

    LibraryProposalIssues describing a requested change to the Go standard library or x/ libraries, but not to a toolNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.help wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions