Giter Site home page Giter Site logo

jacobjohansen / sozu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sozu-proxy/sozu

0.0 1.0 0.0 4.89 MB

Sōzu HTTP reverse proxy, configurable at runtime, fast and safe, built in Rust. It is awesome! Ping us on gitter to know more

Home Page: https://www.sozu.io/

License: GNU Affero General Public License v3.0

Shell 0.30% Rust 99.60% HTML 0.03% Dockerfile 0.07%

sozu's Introduction

Sōzu · Join the chat at https://gitter.im/sozu-proxy/sozu Build Status

Sōzu is a lightweight, fast, always-up reverse proxy server.

Why use Sōzu?

  • Hot configurable: Sozu can receive configuration changes at runtime through secure unix sockets.
  • Upgrades without restarting: Sozu is always-up, meaning it upgrades itself while still processing requests.
  • Handles SSL: Sozu handles SSL, so your backend servers can focus on what they do best.
  • Protects your network: Sozu protect backends by shielding them behind the reverse proxy, limiting direct network access. Sozu uses Rust, a language primed for memory safety. And even if a worker is exploited, sozu workers are sandboxed.

Building and starting

Requirements:

  • openssl 1.0.1 or above (including libraries/includes, ie apt install libssl-dev / rpm install openssl-devel

You can create the required executables like this:

cd ctl && cargo build; cd ../bin && cargo build

This will create the sozu executable for the reverse proxy, and sozuctl to command it.

To start the reverse proxy:

cd bin;
../target/debug/sozu start -c config.toml

You can edit the reverse proxy's configuration with the config.toml file. You can declare new applications, their frontends and backends through that file, but for more flexibility, you should use the command socket (you can find one end of that unix socket at the path designed by command_socket in the configuration file).

sozuctl has a few commands you can use to interact with the reverse proxy:

  • soft shutdown (wait for active connections to stop): sozuctl -c config.toml shutdown
  • hard shutdown: sozuctl -c config.toml shutdown --hard
  • display the list of current configuration messages: sozuctl -c config.toml state dump
  • save the configuration state to a file: sozuctl -c config.toml state save -f state.json

For OSX build

Mac OS uses an old version of openssl, so we need to use one from Homebrew:

brew install openssl
brew link --force openssl

If it does not work, set the following environment variables before building:

export OPENSSL_LIB_DIR=/usr/local/opt/openssl/lib/
export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include/

Logging

The reverse proxy uses env_logger. You can select which module displays logs at which level with an environment variable. Here is an example to display most logs at info level, but use trace level for the HTTP parser module:

RUST_LOG=info,sozu_lib::parser::http11=trace ./target/debug/sozu

Exploring the source

  • lib/: the sozu_lib reverse proxy library contains the event loop management, the parsers and protocols
  • bin/: the sozu executable wraps the library in worker processes, and handle dynamic configuration
  • ctl/: the sozuctl executable can send commands to the reverse proxy

License

Copyright (C) 2015-2018 Geoffroy Couprie, Clément Delafargue and Clever Cloud

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

sozu's People

Contributors

geal avatar blackyoup avatar notbad4u avatar divarvel avatar keruspe avatar waxzce avatar mbstavola avatar roosmaa avatar bthuillier avatar irevoire avatar nicompte avatar pantsman0 avatar messense avatar bheesham avatar ameliabradley avatar cheesedosa avatar fteychene avatar aochagavia avatar urcadox avatar fatimazahramoussaid avatar hgomez avatar badboy avatar rgafiyatullin avatar shirshak55 avatar gitter-badger avatar ybonnel avatar akuracy avatar evuez 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.