Git Product home page Git Product logo

grace's Introduction

Graceful swan takes flight. Hunter eyes his prey. KABLAM! Hunter falls. Swan holsters gun. Server continues running.

grace lets you restart your server without interrupting current users. It's a runtime configurable, port forwarder.

Build Status

Installation

Install the dependencies:

pip install Twisted
pip install PyOpenSSL # if you want SSL support

Either clone repo:

git clone https://github.com/iffy/grace.git grace.git
cd grace.git

Or download a tar:

wget https://github.com/iffy/grace/tarball/master
tar xf master
cd iffy-grace-*

Then install:

python setup.py install

Usage

Start forwarding TCP traffic from port 9000 to port 7500 on the local machine:

grace start tcp:9000 tcp:host=127.0.0.1:port=7500

Switch traffic from port 7500 to port 7600 (without disconnecting anyone still connected to port 7500):

grace switch tcp:9000 tcp:host=127.0.0.1:port=7600

List forwarding rules:

grace ls

Wait for previous forwards to finish:

grace wait

Stop forwarding:

grace stop

It's not just for HTTP

Because grace uses Twisted's excellent endpoints, you can forward just about any traffic to just about anywhere. Here's SSL to TCP:

grace start ssl:443:privateKey=key.pem:certKey=crt.pem tcp:host=127.0.0.1:port=7500

TCP to SSL:

grace start tcp:9000 ssl:host=www.google.com:port=443:caCertsDir=/etc/ssl/certs

TCP to domain socket:

grace start tcp:9000 unix:/var/foo/bar

Domain socket to TCP:

grace start unix:/var/foo/bar tcp:host=127.0.0.1:port=7500

Planned usage not yet supported

Upgrade grace to a new version and swap out the current grace process with a new one:

grace restart

Specify where logs, pid and control socket go (XXX needs more explanation):

grace -d /tmp/foo start tcp:9000 tcp:host=127.0.0.1:port=7500

Running the tests

Use trial to run the tests:

trial grace

grace's People

Contributors

iffy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

grace's Issues

grace.cli.Runner.start doesn't verify that it started

If there's a failure (domain socket name is too long), grace start ... pretends like it succeeded. It should tail the log or in some other way verify that it actually started. Maybe connect to the control socket and ask how it's doing?

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.