Skip to content

Interceptor Proxy Support for Websockets #654

Open
@axisofentropy

Description

@axisofentropy

I'd like this http-add-on Interceptor Proxy to also support WebSocket connections.

Use-Case

Currently WebSocket connections are not supported through the Interceptor proxy. Per this discussion, HTTP requests with upgrade headers receive HTTP 403 responses: #618

I hope we can add logic to the Interceptor proxy to identify HTTP requests with these WebSocket headers and hand them off to a different HTTP handler.

Specification

I found an MIT-licensed library that produces an http.Handler object capable of proxying WebSocket connections. https://github.com/koding/websocketproxy/blob/master/websocketproxy.go

I imagine that when an incoming HTTP request tries to upgrade to a WebSocket connection, the Interceptor's existing Handler can hand it off to another Handler created using this library, which can support a proxied WebSocket connection.

While I'm familiar with the relevant networking protocols, I'm not very familiar with golang and its net.http library. Could this work? Can Handler objects be "chained"? Is this the right integration point?

Alternatively, could we add some pieces of that library to the existing proxy handler to support WebSockets?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededstale-bot-ignoreAll issues that should not be automatically closed by our stale bot

    Type

    No type

    Projects

    Status

    To Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions