• Stars
    star
    495
  • Rank 88,335 (Top 2 %)
  • Language
    Go
  • License
    GNU Affero Genera...
  • Created almost 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A multi-connection TCP forwarder/accelerator

Rabbit TCP

Build badge Docker pull badge

A multi-connection TCP forwarder created for accelerating TCP connections

English | 中文

Introduction

This project is created to support and forward TCP connections. It will split bytes into blocks and reconstruct them during forwarding. All upper connections visible to all users are carried by N underlying physical connections, and even a single upper connection is forwarded through all underlying connections.

Due to the use of multiple connections, similar to the multi-threaded downloader, this project can accelerate the connection without any more traffic consumption (bilateral deployment is required). This project the extension of the accelerating method of ShadowSocks-magic.

Rabbit TCP

Get Started

This project can work in standalone proxy mode or inline in other Golang code.

Here are two common usage examples. For detailed documentation, please go to the Wiki.

Accelerate any TCP service in a standalone proxy mode

Server side

  1. Install Docker and docker-compose
  2. Download and edit docker-compose-server.yml (Link)
    rabbit-server:
      image: ihciah/rabbit
      ports:
        - "$RABBIT_PORT:9891/tcp"
      environment:
        - MODE=s
        - PASSWORD=$RABBIT_PASSWORD
        - RABBITADDR=:9891
        - VERBOSE=2
      restart: always
    • $RABBIT_PORT replaced with RabbitTCP service port, which should be the same as the client side
    • $RABBIT_PASSWORD replaced with RabbitTCP service password, which should be the same as the client side
  3. Run in the same directory docker-compose -f docker-compose-server.yml up -d

Client side

  1. Install Docker and docker-compose
  2. Download and edit docker-compose-client.yml (Link)
    rabbit-client:
      image: ihciah/rabbit
      ports:
        - "$CLIENT_LISTEN_PORT:9892/tcp"
      environment:
        - MODE=c
        - PASSWORD=$RABBIT_PASSWORD
        - RABBITADDR=$RABBIT_ADDR
        - LISTEN=:9892
        - DEST=$SERVICE_ADDR
        - TUNNELN=6
        - VERBOSE=2
      restart: always
    • $RABBIT_ADDR replaced with ip_or_domain:port , which should be the same as the server side
    • $RABBIT_PASSWORD replaced with RabbitTCP service password, which should be the same as the server side
    • $SERVICE_ADDR replaced with the ip_or_domain:port of the target service
    • $CLIENT_LISTEN_PORT replaced with local listen port, which can be dialed when connecting to the target service with acceleration.
    • Modify TUNNELN if you want to change count of physical connections
  3. Run in the same directory docker-compose -f docker-compose-server.yml up -d

Accelerate ShadowSocks service in a standalone proxy mode with plugin

The server-side configuration is the same as above. Please note that except for Rabbit TCP server, you have to run ShadowSocks service too.

Configure client-side as above is useful too if you want to run a forwarder on a server inside the blocked area.

However, run docker or daemon service on client devices is not so user-friendly. What recommended is the plugin built for ShadowSocks: Rabbit Plugin.

  1. Download the latest Rabbit Plugin release, unzip it and put it into the ShadowSocks folder(same as ShadowSocks.exe).
  2. Fill in ShadowSocks client configuration(Take ShadowSocks Windows as an example)
    • Server Addr: Rabbit TCP service ip/domain
    • Server Port: Rabbit TCP service port
    • Password: ShadowSocks password
    • Encryption: ShadowSocks Encryption
    • Plugin Program: The binary filename(without .exe)
    • Plugin Options: serviceAddr=SHADOWSOCKS_ADDR;password=RABBIT_PASSWORD;tunnelN=4
      • SHADOWSOCKS_ADDR is ShadowSocks server address(ip:port or domain:port), for example: 10.10.10.10:443
      • RABBIT_PASSWORD is Rabbit TCP password
      • Modify tunnelN to change count of physical connections
  3. Save

Speedup Result

Environment:

  • Chrome <--> ShadowsocksWindows <--> RabbitTCP <==[ISP]==> RabbitTCP <--> ShadowsocksLibev
  • Local ISP: China Unicom - Shanghai
  • Remote ISP: Amazon LightSail - Tokyo
  • Physical Connections Count: 4

Speedup with Rabbit TCP(Link):

Speed with rabbit-tcp

Original ShadowSocks libev(Link):

Speed without rabbit-tcp

More Repositories

1

shadow-tls

A proxy to expose real tls handshake to the firewall
Rust
2,224
star
2

clean-dns-bpf

基于 Rust + eBPF 丢弃 GFW DNS 污染包
Rust
1,106
star
3

deep-fashion-retrieval

Simple image retrival on deep-fashion dataset with pytorch - A course project
Python
231
star
4

miaomiaoji-tool

A python tool to control MiaoMiaoJi / Paperang / 喵喵机
Python
154
star
5

go-shadowsocks-magic

A shadowsocks implementation in golang with Multi-connection Acceleration
Go
153
star
6

rust2go

Call Golang from Rust
Rust
147
star
7

tg_channel_bot

Fetch and push to telegram channel/user/group !
Go
99
star
8

inner-shadowsocks

Shadowsocks -> socks5 on server. (Created for providing socks5 proxy for Telegram)
Go
90
star
9

small-map

An inline SIMD accelerated hashmap designed for small amount of data.
Rust
71
star
10

mini-rust-runtime

Rust
49
star
11

google-in-docker

A google reverse proxy in docker
46
star
12

telearia2

Rust
42
star
13

socks5-forwarder

Rust
42
star
14

NAS-tools

Some configure files and scripts for NAS
Shell
40
star
15

CNN_forward

CNN(Convolutional neural network) forward code which requires little dependency(Opencv, TBB-optional) and is easy to run on Windows(using caffe's model)
C++
34
star
16

shadowsocks-with-socks-auth

Shadowsocks with socks auth
Python
33
star
17

ddns-worker

Rust
32
star
18

cloudflare-kv-proxy

Cloudflare Worker KV Proxy
Rust
29
star
19

certain-map

A typed map which can make sure item exist.
Rust
29
star
20

GFHelper

Girl Frontline Helper
Go
25
star
21

rabbit-plugin

A rabbit-tcp plugin for shadowsocks
Go
25
star
22

AndroidSMSRelay

Script to forward and send android(with root) sms using adb
Python
22
star
23

subtitle

A cli tool to download subtitles.
Python
19
star
24

OneEncrypt

A Simple and Naive Encryptor for OneDrive(已投奔OSX,弃坑了!)
C
12
star
25

singleflight-async

Rust
11
star
26

service-async

A Service like tower in async style
Rust
10
star
27

thrift-parser

Rust Thrift Parser
Rust
9
star
28

aria2-rs

Yet Another Aria2 JSON-RPC Client.
Rust
8
star
29

xbox-nginx

xbox 国内加速代理
HTML
8
star
30

simple-ddns

A Simple Dynamic DNS Server for Personal Usage
Python
8
star
31

auto-const-array

Declare a const array without specify its length
Rust
8
star
32

simple-qq-bot

A simple QQ bot (Test account: 2404865065)
Python
7
star
33

HamsterRunning

Automatically log hamsters' running data and send to weibo
Python
7
star
34

trojan-caddy-docker-compose

Dockerfile
7
star
35

wol-homekit

WakeOnLAN with HomeKit
Rust
6
star
36

stinc

Shadowsocks + tinc + chnroute in docker
Shell
5
star
37

urlshorter

网址缩短 附带便笺条功能(On SAE)
CSS
5
star
38

cookieinjector

Wireshark cookie injector for tampermonkey
JavaScript
5
star
39

byte-style-encoder

Rust
4
star
40

static-blog-image-downloader

Rust
4
star
41

douban-api-proxy

豆瓣电影搜索API代理
JavaScript
4
star
42

must-done

An experimental Future that is guaranteed to be done
Rust
3
star
43

leetcode-in-rust

leetcode in rust
Rust
3
star
44

classifier-mt

Caffe classifier with multi-thread
C++
2
star
45

oj

做过的oj题目 顺手发上来
C++
2
star
46

bounded-pool

Rust
2
star
47

dorm_tools

寝室自用小工具
Python
1
star
48

XV6-OS

XV6 in OS_class
C
1
star
49

fdcard-captcha

复旦一卡通网站验证码识别(简易SVM
Python
1
star
50

pj

sww的PJ!
C#
1
star
51

MiniJava

MiniJava前端 编译原理Project
HTML
1
star
52

nas-bot

自用Telegram Bot
Go
1
star
53

FudanPTAutoDownloader

A script for auto download torrents of PT@Platform
Python
1
star
54

docker-ocserv

Shell
1
star
55

xk-database

某科学的张江大学选课系统-汪卫的数据库PJ
CSS
1
star