Kentaro Kuribayashi's blog

Software Engineering, Management, Books, and Daily Journal.

Delta - HTTP Shadow Proxy Server Written in Go

I just created a tool named "Delta". It's the first Go code for me. The reason why I created and wrote it in Go is that I just wanted to learn Go by writing some lines of code ;)

What's "Delta"?

Delta is an HTTP shadow proxy server that sits between clients and your server(s) to enable "shadow requests".

It's actually just a Go port of Kage. You can consult the documentation of Kage for reasons why this software matters ;)


package main

import (

func main() {
    server := delta.NewServer("", 8484)

    server.AddMasterBackend("production", "", 8080)
    server.AddBackend("testing", "", 8081)

    server.OnSelectBackend(func(req *http.Request) []string {
        if req.Method == "GET" {
            return []string{"production", "testing"}
        } else {
            return []string{"production"}

    server.OnMungeHeader(func(backend string, header *http.Header) {
        if backend == "testing" {
            header.Add("X-Delta-Sandbox", "1")

    server.OnBackendFinished(func(responses map[string]*delta.Response) {
        for backend, response := range responses {
            log.Printf("%s [%d ms]: %s", backend, (response.Elapsed / time.Millisecond), response.Data)



  • Kage
  • Geets
  • Gor
    • It's a tool written in Go to deal with a similar problem