Git Product home page Git Product logo

aioshadowsocks's Introduction

Build Status

aioshadowsocks

用 asyncio 重写 shadowsocks

为什么要重写shadowsocks

主要想通过这个项目的推进来深入了解 asyncio

另外我的一个项目: django-sspanel 依赖shadowsocksr

但该项目已经停止开发了,所以决定重新造个轮子

主要功能

  • tcp/udp 代理
  • 开放了grpc接口(类似ss-manager)

rpc proto

syntax = "proto3";

package aioshadowsocks;

// REQ
message UserIdReq { int32 user_id = 1; }

message UserReq {
  int32 user_id = 1;
  int32 port = 2;
  string method = 3;
  string password = 4;
  bool enable = 5;
}

// OBJ
message Empty {}

message User {
  int32 user_id = 1;
  int32 port = 2;
  string method = 3;
  string password = 4;
  bool enable = 5;
}

message UserServer {
  int32 user_id = 1;
  int64 upload_traffic = 2;
  int64 download_traffic = 3;
  repeated string ip_list = 4;
  bool is_running = 5;
}
// service
service ss {
  rpc CreateUser(UserReq) returns (User) {}
  rpc UpdateUser(UserReq) returns (User) {}
  rpc GetUser(UserIdReq) returns (User) {}
  rpc DeleteUser(UserIdReq) returns (Empty) {}
  rpc InitUserServer(UserIdReq) returns (UserServer) {}
  rpc GetUserServer(UserIdReq) returns (UserServer) {}
  rpc StopUserServer(UserIdReq) returns (Empty) {}
}

使用

  • 安装依赖
wget https://bootstrap.pypa.io/get-pip.py

python3 get-pip.py

pip3 install -r requirements.txt
  • 注入环境变量

export SS_API_ENDPOINT="https://xxx/com"

  • 使用
python server.py

Docker Version

  1. install docker
curl -sSL https://get.docker.com/ | sh
  1. install docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  1. apply executable permissions
sudo chmod +x /usr/local/bin/docker-compose
  1. run server
docker-compose up

aioshadowsocks's People

Contributors

ehco1996 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.