Giter Site home page Giter Site logo

naresh97 / trojan-rs Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 97 KB

A Trojan proxy implementation written in Rust. Optimizing for size.

License: GNU General Public License v3.0

Rust 100.00%
network privacy proxy rust tls tunnel censorship-circumvention

trojan-rs's Introduction

trojan-rs

GitHub Actions Workflow Status

To circumvent certain firewalls, I previously used trojan-go which worked pretty well. Unfortunately, the binary size of around 8MB was slightly too large to use on my portable router runnin OpenWRT. So I decided to write an implementation of the Trojan Client/Server in Rust.

The goal is to keep the binary under 1MB.

Based on the Trojan protocol described here.

Usage

Modify client.toml and server.toml appropriately. See samples.

trojan-rs [OPTIONS] <COMMAND> [ADAPTER]

Commands:
  server  runs the Trojan Server
  client  runs the Trojan Client with the specified adapter

Options:
  --config <FILE>   defaults to "./server.toml" or "./client.toml"
  --log             defaults to INFO
                    values: DEBUG, INFO, WARN, ERROR

Adapter:
  --adapter <ADAPTER_TYPE>  used in client mode
                            defaults to socks5
                            values: socks5 tun

Architecture

On the client side:

CLIENT <-> SOCKS5 SERVER <-> TROJAN CLIENT <-> INTERNET

On the server side:

INTERNET <-> TROJAN SERVER  <-> SERVER
                            <-> FALLBACK

trojan-rs's People

Contributors

naresh97 avatar

Stargazers

Justin avatar  avatar

Watchers

 avatar

trojan-rs's Issues

Implement port 80 redirection

Currently, the server will not listen on port 80, therefore HTTP requests will fail. Implement a listener on Port 80 that will send a REDIRECT to the HTTPS site

tproxy support

I see that tun was added, i guess it is used to do global proxy without setting proxy for individual program, to be honest, tproxy is much faster than tun.

udp does not work

trojan protocol can handle udp traffic, but this software does not support UDP.

For example dig @1.1.1.1 example.com via socks5 proxy.

Implement simple fileserver for the fallback

Currently the use must provide an external resource, ie. apache webserver to server fallback content. Implementing a simple file server will allow the user to implement a static website as a fallback without external tools

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.