Skip to content
a WebSocket-aware SSL-capable HTTP reverse proxy/load balancer. Please note that development continues at
Latest commit 0e2cd50 Jan 16, 2013 @akrennmair akrennmair Merge pull request #1 from akrennmair/master
fix formatting; fix minor issue in connection upgrade detection.
Failed to load latest commit information.
doc add concept drawing. Jul 31, 2012
.gitignore Initial commit Jul 4, 2012
Makefile add first prototype. Jul 4, 2012 document HTTPS support and logging. Jul 29, 2012


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 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 =
backends = fallback

backends = backend1

backends = backend2

[backend backend1]
connect =

[backend backend2]
connect =

[backend fallback]
connect =

The frontend binds to, and handles rquests with the Host headers,, and All other requests are handled by the backend fallback and forwarded to Requests for and are handled by backend1, which in turns forwards the requests to, while requests for and 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

Something went wrong with that request. Please try again.