Giter VIP home page Giter VIP logo

leaf's Introduction

releases ci

Leaf

A versatile and efficient proxy framework with nice features suitable for various use cases.

Multiplexing

There are 2 transports for traffic multiplexing:

  • AMux: A multiplexd transport based on reliable streams suitable for TCP-based protocols and transports
  • QUIC: A UDP-based, multiplexed and secure transport

The benefit of amux is that we can reuse connections to reduce handshake overhead, it's not designed to be memory efficient because it focus only on reusing connections and not reducing the number of connections. While quic can reduce both handshake overhead and memory usage without suffering the head-of-line blocking issue.

Transparent Proxying

There's the TUN inbound for this purpose, which is also of fundamental importance for VPN-like proxying use cases such as VPN apps on iOS and Android.

High Availability

Outbounds such as failover, tryall, retry, random and their combinations are able to flexibly deliver reqeusts to other outbounds based on their own metrics to achieve high availability or load balancing behaviors.

Request Routing

Rule-based request routing is also supported. Requests can be routed to different outbounds based on domain, IP, GEOIP and port rules.

Getting Started

[General]
dns-server = 223.5.5.5
socks-interface = 127.0.0.1
socks-port = 1080

[Proxy]
Direct = direct

More configuration examples can be found here. If you want more flexible control on the config options, the JSON format should be used, up-to-date examples for the JSON format could be found in the tests, both client-side and server-side config examples are presented there.

TUN Mode and Gateway Mode

TUN Mode

This syntax (tun = auto) is supported on macOS and Linux.

[General]
dns-server = 223.5.5.5
tun = auto

[Proxy]
Direct = direct

Gateway Mode

Running in gateway mode requires a configuration with TUN mode enabled. Gateway mode can be enabled by an environment variable.

GATEWAY_MODE=true leaf -c config.conf

Windows

  • Maple: A lightweight Universal Windows proxy app based on leaf

iOS & Android

Build

Install Rust: https://www.rust-lang.org/tools/install

Install GCC or Clang.

Clone & Build:

git clone --recursive https://github.com/eycorsican/leaf.git
cd leaf
cargo build -p leaf-bin

Run:

./target/debug/leaf --help

License

This project is licensed under the Apache License 2.0.

leaf's People

Contributors

eycorsican avatar bdbai avatar trumpfounder avatar spongebob888 avatar iruizr7 avatar ekkog avatar kidonng avatar perqin avatar netheril96 avatar lemos1235 avatar monnerhenster avatar vkill avatar zh-yjie avatar kylericardo 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.