koding / websocketproxy

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

Added support to proxy paths. #2

Closed tux-cheeleong closed 9 years ago

tux-cheeleong commented 9 years ago

Minor addition to allow the proxy to pass request path and parameter.

fatih commented 9 years ago

Hi @tuxccl. You know that you can build your own custom proxy with passing the Backend your self. Is there any reason we want it in the default example constructor?

tux-cheeleong commented 9 years ago

There are cases where upstream serves multiple paths and take in parameter (example, /hello/world?foo=bar). But the default behaviors ignores these from the request and assume upstream serving only the root. Probably it is sufficient in your use case but adding these few lines is enough for a more general use case (it might look hackish because I don't want to change the interface).

fatih commented 9 years ago

Got it, thanks for the reply. I just wanted to be sure :) Merging it, thanks :+1: