Giter Site home page Giter Site logo

srini156 / ergo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cristianoliveira/ergo

0.0 1.0 0.0 3.45 MB

The management of multiple local apps running over different ports made easy

License: MIT License

Makefile 4.05% Shell 8.89% Go 86.63% JavaScript 0.43%

ergo's Introduction

Ergo GoDoc Go Report Card unix build win build

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.

Demo

More you can see in examples

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

Feedback

This project is under development but it's already usable. Feel free to give me feedback and opening issues. Suggestions and contributions are welcome. :)

Why?

When dealing with multiple apps locally is really annoying having to remember each port that represents each service and it gets even worse when you have microservices. So I wanted a simple way to give a proper local domain for each app. Ergos comes to solve this simple problem.

Installation

OSX

brew tap cristianoliveira/tap
brew install ergo

Linux

curl -s https://raw.githubusercontent.com/cristianoliveira/ergo/master/install.sh | sh

Windows

For windows you can find the executable in each release.

Disclaimer: I only use unix based systems on my daily basis, so I can't test each build :(

Using go

go install github.com/cristianoliveira/ergo

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

Usage

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

Let's start:

Simplest Setup

You need to set the http://127.0.0.1:2000/proxy.pac configuration on your system network config

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

  • osx
  • linux-gnome

(Contributions are welcomed)

ergo setup <operation-system>

In case of errors or if it doesn't work please take a look on detailed config session below.

Showtime

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

Now you are able to access: http://ergoproxy.dev. Ergo redirects anything that finish with .dev to the configured url.

Simple right? No magic involved.

Do you want add more services? So is easy, just add more lines in .ergo:

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

Restart the server and access: http://otherservice.dev

Configuration

In order to use Ergo domains you need to set it as a proxy. Set the http://127.0.0.1:2000/proxy.pac on:

OS X

Network Preferences > Advanced > Proxies > Automatic Proxy Configuration

Windows

Settings > Network and Internet > Proxy > Use setup script

Linux

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.

Chrome

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

Ephemeral Setup

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

Testing

Running tests:

  make test

Contributing

  • 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

Pull Requests are welcome!

Pull Request should have unit tests

License

MIT

ergo's People

Contributors

cristianoliveira avatar mileswilson avatar sitaramshelke avatar srini156 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.