Coder Social home page Coder Social logo

jessa0 / shadowsocks-erlang Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paulzql/shadowsocks-erlang

1.0 0.0 0.0 759 KB

erlang port of shadowsocks (The next generation is elixir http://github.com/paulzql/shadowsocks-ex )

License: Other

Erlang 100.00%

shadowsocks-erlang's Introduction

shadowsocks-erlang (sserl)

shadowsocks-erlang is a erlang port of shadowsocks

A fast tunnel proxy that helps you bypass firewalls.

Features:

  • TCP support
  • Client support
  • Server support
  • OTA support
  • Mulit user support
  • User management API support
  • IP blacklist support [TODO]

Encryption methods

  • table (deprecated)
  • rc4-md5
  • aes-128-cfb
  • aes-192-cfb
  • aes-256-cfb

Note: this is an erlang app/lib of shadowsocks, not an installable application. you can run with erlang VM or package in your erlang release

  • Live demo

    The sserl is already running on X-NET, you can try it on http://x-net.vip

Build

$ rebar3 compile

Usage

  • start
    application:start(sserl).
  • stop
    application:stop(sserl).
  • start / update listener

If the port already started,the method, password and expiretime will be updated.

    Args = [{port, 8388}, {type, server}, {ota, false}, {method, "rc4-md5"},{password,"xx"}],
    sserl_listener_sup:start(Args).
  • stop listener
    sserl_listener_sup:stop(8388)

Configuration

sserl support cuttlefish, you can easy configure with cuttlefish schema.

  • cuttlefish files

    priv/sserl.schema

  • env config

     {sserl,
     [
         {listener, [ %% a list of listener args
                 [{ip, {0,0,0,0}},      %% listen ip  [optional]
                  {port, 1080}          %% listen port
                  {method, "rc4-md5"},  %% encryption method
                  {password, "mypass"}, %% password
                  {ota, true},          %% use OTA [optional]
                  {expire_time, 1472402802},  %% expire time (unix time) [optional]
                  {conn_limit, 1024},   %% max synchronize connections on the port [optional]
                  {type, client},       %% listener type (client or server)
                  {server, {"x-net.vip", 8388}} %% shadowsocks server (client only) [optional]
                  ],
                  [ %% other listeners
                    ...
                  ]
         ]},
         %% --------------------------------------
         %% shadowsocks-panel integration support
         %% --------------------------------------
         {sync_enable, false},   %% enable synchronize users from ss-panel
         {sync_node_id, 1},      %% the node id on ss-panel
         {sync_mysql_host, "x-net.vip"}, 
         {sync_mysql_port, 3306},        
         {sync_mysql_db,   "ss-panel"}, 
         {sync_mysql_user, "root"},
         {sync_mysql_pass, "123456"},
         {sync_report_min, 1048576}    %% bytes threshold to report flow
     ]}

Cluster

sserl will share the flow data with joined cluster

  • Start cluster
    mnesia_cluster:join('[email protected]').
  • Leave cluster
    mensia_cluster:leave().

Events

%% flow event report: {report, Port, Download, Upload}
%% 
-define(FLOW_EVENT, sserl_flow_event).

%% stat event
%%      new listener {listener, new, Port}
%%      accept    :  {listener, accept, Addr, Port}
%%      open      :  {conn, open, Pid}
%%      close     :  {conn, close, Pid, Reason}
%%      connect   :  {conn, connect, Addr, Port}
%% 
-define(STAT_EVENT, sserl_stat_event).

License

BSD

shadowsocks-erlang's People

Contributors

paulzql avatar jessa0 avatar

Stargazers

 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.