ss-n

1.0.0 • Public • Published

ss-n

This is a Node port of shadowsocks.

Feature

  • TCP & UDP support
  • Extendable cryptor

Method

  • aes-128-ctr
  • aes-192-ctr
  • aes-256-ctr
  • aes-128-cfb
  • aes-192-cfb
  • aes-256-cfb
  • camellia-128-cfb
  • camellia-192-cfb
  • camellia-256-cfb
  • bf-cfb
  • rc4
  • rc4-md5

Install

You need to firstly install Node environment. Node version need to be up to 8.0 and npm (node package manager) is integrated with Node installer. You could find information here.

Install from npm

# global install 
$ npm i -g ss-n

Usage

Local

Usage: sslocal [options]
 
Options:
    -v, --version               output the version number
    -c, --config <path>         set custom config
    -a, --server <string>       set remote server address
    -p, --server_port <number>  set remote server port
    -s, --local <string>        set local server address
    -o, --local_port <number>   set local server port
    -k, --password <string>     set password
    -m, --method <string>       set method
    -t, --timeout <number>      set timeout
    -l, --log                   log output for debug
    -h, --help                  output usage information

All set options will automatically overwrite the internal configuration file and save down, that means all settings will be saved and next time you won't set them again.

To start:

$ sslocal

To start with settings:

# you could just offer some of them 
$ sslocal -a 123.123.123.123 -p 8000 -s localhost -o 1080 -k test -m aes-256-cfb -t 600

To start with logs:

$ sslocal -l

To start with configuration:

# offer absolute path. ignore settings if use -c 
$ sslocal -c /usr/local/ss-n/lib/local/config.json

Configuration is like below, and all supported keys are listed.

{
    "server": "127.0.0.1",
    "server_port": "8000",
    "local": "localhost",
    "local_port": "1080",
    "password": "test",
    "method": "aes-256-cfb",
    "timeout": "600"
}
setting value remark
server required remote server address
server_port required remote server port
local optional local server address, default: localhost
local_port optional local server port, default: 1080
password optional for encryptiong, default: test
method optional encrpytion method, default: aes-256-cfb
timeout optional server timeout in second, default: 600

Server

Usage: ssserver [options]
 
Options:
    -v, --version               output the version number
    -c, --config <path>         set custom config
    -a, --server <string>       set remote server address
    -p, --server_port <number>  set remote server port
    -k, --password <string>     set password
    -m, --method <string>       set method
    -t, --timeout <number>      set timeout
    -l, --log                   log output for debug
    -h, --help                  output usage information

Same as sslocal. All set options will automatically overwrite the internal configuration file and save down.

To start:

$ ssserver

To start with settings:

# you could just offer some of them 
$ ssserver -a 123.123.123.123 -p 8000 -k test -m aes-256-cfb -t 600

To start with logs:

$ ssserver -l

To start with configuration:

# offer absolute path. ignore settings if use -c 
$ ssserver -c /usr/local/ss-n/lib/server/config.json

Global configuration is like:

{
    "server": "127.0.0.1",
    "server_port": "8000",
    "password": "test",
    "method": "aes-256-cfb",
    "timeout": "600"
}
setting value remark
server optional remote server address, set automatically if missing
server_port required remote server port
password optional for encryptiong, default: test
method optional encrpytion method, default: aes-256-cfb
timeout optional server timeout in second, default: 600

Besides, you can set multiple servers for different users by "servers", like below. "servers" will be priorly accepted if both global configuration and "servers" exist.

{
    // global configuration
    "server": "123.123.123.123",
    "server_port": "8000",
    "password": "origin",
    "method": "aes-256-cfb",
    "timeout": "600",
    // "servers" setting
    "servers": [
        {
            // "server" will be the same as global configuration
            "server_port": "8000",
            "password": "test",
            "method": "aes-256-cfb",
            "timeout": "600"
        },
        {
            "server": "123.123.123.100",
            "server_port": "8001",
            // "password", "method" and "timeout" will be the same
            // as global configuration
        }
    ]
}
setting value remark
servers.server optional same as global server if missing, or set automatically if no global server
servers.server_port required remote server port
servers.password optional same as global password if missing
servers.method optional same as global method if missing
servers.timeout optional same as global timeout if missing

About AEAD Support

Currently AEAD won't be supported, because it might be unnecessary. When encountering unmatched ip types, servers will refuse after random timeout, against active port scanning.

Package Sidebar

Install

npm i ss-n

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • siubaak