Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time
May 25, 2023 12:04
October 31, 2018 08:50
November 29, 2018 08:35
August 19, 2017 20:41
August 23, 2017 14:36
May 22, 2023 21:34

Ergo GoDoc Go Report Card unix win build codecov

Ergo Proxy - The reverse proxy agent for local domain management.

The management of multiple apps running over different ports made easy through custom local domains.


See more on examples



Ergo's goal is to be a simple reverse proxy that follows the Unix philosophy of doing only one thing and doing it well. Simplicity means no magic involved. Just a flexible reverse proxy which extends the well-known /etc/hosts declaration.


This project is constantly undergoing development, however, it's ready to use. Feel free to provide feedback as well as open issues. All suggestions and contributions are welcome. :)

For help and feedback you can find us at #ergo-proxy channel on


Dealing with multiple apps locally, and having to remember each port representing each microservice is frustrating. I wanted a simple way to assign each service a proper local domain. Ergo solves this problem.


Important These are the only official ways to install ergo.


brew tap cristianoliveira/tap
brew install ergo


curl -s | sh


From powershell run:

Invoke-WebRequest -out ./install.ps1; ./install.ps1

You can also find the Windows executables in release.

Disclaimer: I use Unix-based systems on a daily basis, so I am not able to test each build alone. :(


go install

Make sure you have $GOPATH/bin in your path: export PATH=$PATH:$GOPATH/bin


Ergo looks for a .ergo file inside the current directory. It must contain the names and URL of the services following the same format as /etc/hosts (url:port+space+domain). The main difference is it also considers the specified port.

Simplest Setup

You need to set the configuration on your system network config.

Ergo comes with a setup command that can configure it for you. The current systems supported are:

  • osx
  • linux-gnome
  • windows
ergo setup <operation-system>

In case of errors / it doesn't work, please look at the detailed config session below.

Adding Services and Running

OS X / Linux

echo "http://localhost:3000 ergoproxy" > .ergo
ergo run

Now you should be able to access: Ergo redirects anything ending with .dev to the configured url.


You should not use the default .dev domain, we suggest .test instead (see #58) unless your service supports https out of the box and you have already a certificate

set ERGO_DOMAIN=.test
echo "http://localhost:3000 ergoproxy" > .ergo
ergo list # you shouldn't see any quotas in the output
ergo run

Now you should be able to access: http://ergoproxy.test. Ergo redirects anything ending with .test to the configured url.

Simple, right? No magic involved.

Do you want to add more services? It's easy, just add more lines in .ergo:

echo "http://localhost:5000 otherservice" >> .ergo
ergo list
ergo run

Restart the ergo server and access:

ergo add otherservice http://localhost:5000 is a shorthand for appending lines to ./.ergo

Ergo's configuration

Ergo accepts different configurations like run in different port (default: 2000) and change domain (default: dev). You can find all this configs on ergo's help running ergo -h.


In order to use Ergo domains you need to set it as a proxy. Set the on:

Networking Web Proxy


Network Preferences > Advanced > Proxies > Automatic Proxy Configuration


Settings > Network and Internet > Proxy > Use setup script


On Ubuntu

System Settings > Network > Network Proxy > Automatic

For other distributions, check your network manager and look for proxy configuration. Use browser configuration as an alternative.

Browser configuration

Browsers can be configured to use a specific proxy. Use this method as an alternative to system-wide configuration.

Keep in mind that if you requested the site before setting the proxy properly, you have to reset the cache of the browser or change the name of the service. In incognito windows cache is disabled by default, so you can use them if you don't wish to delete the cache

Also you should not use the default .dev domain, we suggest .test instead (see #58) unless your service supports https out of the box and you have already a certificate


Exit Chrome and start it using the following option:

# Linux
$ google-chrome --proxy-pac-url=http://localhost:2000/proxy.pac

# OS X
$ open -a "Google Chrome" --args --proxy-pac-url=http://localhost:2000/proxy.pac


through menus and mouse
  1. Click the hamburger button otherwise click on "Edit" Menu
  2. then "Preferences"
  3. then "Settings" button at the bottom of the page ("General" active in sidebar) with title "Network Settings"
  4. check Automatic Proxy configuration URL and enter value http://localhost:2000/proxy.pac below
  5. hit "ok"
from about:config

network.proxy.autoconfig_url -> http://localhost:2000/proxy.pac

Using on terminal

In order to use ergo as your web proxy on terminal you must set the http_proxy variable. (Only for linux/osx)

export http_proxy="http://localhost:2000"

Ephemeral Setup

As an alternative you can see the scripts inside /resources for running an ephemeral setup. Those scripts set the proxy only while ergo is running.


  • Fork it!
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request, they are welcome!
  • Please include unit tests in your pull requests


Minimal required golang version go1.17.6. We recommend using GVM for managing your go versions.

Then simply run:

gvm use $(cat .gvmrc)


  make all


make test
make test-integration # Requires admin permission so use it carefully.