moxy

command module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2015 License: MIT Imports: 17 Imported by: 0

README

moxy

Build Status

moxy is a HTTP Reverse Proxy and Load Balancer that automatically configures itself for microservices deployed on Apache Mesos and Marathon. It is inspired by Vulcand and moxy does in fact use the same proxy library written by the nice people at Mailgun.

Features:

  • Reverse proxy and load balancer for your microservices running inside Mesos and Marathon
  • Single binary with no other dependencies for easy deployment
  • Supports TLS termination
  • Statistics of req/s per application via statsd
  • Event callback listener to automatically be up-to-date with Marathon
  • Local file backups of Marathon states, so moxy will keep serving your apps even if Marathon goes down
    • more on the works...

Compatibility

Tested againts Marathon 0.8.1 and Mesos 0.22.1

Getting started

Edit moxy.toml:

port = "7000"
marathon = "http://localhost:8080"
statsd = "example.com:8125" # optional if you want to graph req/s per app
tls = false # optional if you want moxy to terminate tls
cert = "cert.pem"
key = "key.pem"

Add the moxy url + /moxy_callback to your callbacks in Marathon.

Start moxy!

Using Moxy

Routing is based on the HTTP Host header matching app.* Example: app.example.com and app.example.org both route to the same tasks running that app.

Example to access your apps app1,app2,app3 running in Mesos and Marathon:

curl -i localhost:7000/ -H 'Host: app1.example.com'
curl -i localhost:7000/ -H 'Host: app2.example.com'
curl -i localhost:7000/ -H 'Host: app3.example.com'
To set custom subdomain for an application

Deploy your app to Marathon setting a custom label called moxy_subdomain:

"labels": {
    "moxy_subdomain": "foobar"
},

This will override the application name and replace it with foobar as the new subdomain/host-header.

Check state of Moxy
  • /moxy_stats for traffic statistics

  • /moxy_apps list apps and running tasks for load balancing

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL