a WebSocket-aware SSL-capable HTTP reverse proxy/load balancer
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 1 commit behind joinmytalk:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



drunken-hipster is a WebSocket-aware SSL-capable HTTP reverse proxy/load balancer.


First, make sure you have the Go build environment correctly installed. See http://golang.org/ for more information.

Then run "make". This will in turn call the go utility to build the load balancer, resulting in a binary named hipsterd.


The principle of drunken-hipster is simple: you define one or more frontends (i.e. the interface and port on which it shall listen on), and connect each frontend with one or more backends (i.e. the IP address or host and port it shall connect to). Requests that are received by the frontend are then forwarded to each of the backends in a round-robin fashion, and the responses will be sent back to the client.

Alternatively, you can define a frontend that handles a number of hostnames, as indicated by the HTTP Host request header. For each hostname, you can again define one or more backends. If a request is encountered with a Host header that doesn't match any of the configured hostnames, the list of backends directly associated with the frontend is used instead.

Confused? Let's take a look at a simple configuration example:

[frontend frontend1]
bind =
backends = backend1

[backend backend1]
connect =

This is probably the simplest example possible. It defines a frontend that binds to, and forwards all its incoming requests to only one backend. This backend will send these forwarded requests to

Now let's show a more complicated, host-based configuration:

[frontend frontend1]
bind =
hosts = example.com www.example.com foobar.com www.foobar.com
backends = fallback

[host example.com www.example.com]
backends = backend1

[host foobar.com www.foobar.com]
backends = backend2

[backend backend1]
connect =

[backend backend2]
connect =

[backend fallback]
connect =

The frontend binds to, and handles rquests with the Host headers example.com, www.example.com, foobar.com and www.foobar.com. All other requests are handled by the backend fallback and forwarded to Requests for example.com and www.example.com are handled by backend1, which in turns forwards the requests to, while requests for foobar.com and www.foobar.com are forwarded by "backend2" to

If you want to have the original client's IP address forwarded to your backend servers, you can optionally enable X-Forwarded-For headers:

[frontend foo]
bind =
backends = bar baz quux
add-x-forwarded-for = true

drunken-hipster also supports WebSockets out of the box. No special configuration is necessary. WebSockets are recognized by the Connection: upgrade and Upgrade: websocket HTTP requests headers.

HTTPS Support

You can enable HTTPS support for a frontend in the following way:

[frontend my-frontend]
bind = [::]:443
https = true
keyfile = /path/to/key.pem
certfile = /path/to/cert.pem


If you want to write an access log for all HTTP requests that happen on all frontends, set the desired target file in the global section:

accesslog = /var/log/hipsterd.access.log


See the file LICENSE for license information.


Andreas Krennmair ak@synflood.at