ycgambo/shadowrocket

A PHP shadowsocks component


Keywords
Socket, Shadowsocks, composer-component, php, proxy, socket-tunnel, socks-proxy, socks5
License
MIT

Documentation

shadowrocket

A socks5 proxy to build your own shadowsocks private network. PHP based & Composer supported.

中文文档 Contributing

Features

  1. TCP/UDP support
  2. IPV4/DOMAINNAME/IPV6 support
  3. Graceful restart
  4. Monolog Logger
  5. Guarder(Black List)
  6. Server Manager

Coming Next

  • bandwidth throttling
  • user management

Install

composer require ycgambo/shadowrocket

Requirements

  1. Composer
  2. PHP 5.3+

Usage

Run a server

<?php
require_once __DIR__ . '/vendor/autoload.php';

$config = array(
    'server' => array(
        'port'        => '8388',
        'password'    => 'mypass',
        'encryption'  => 'aes-256-cfb',
        'process_num' => 12,
    ),
);

ShadowRocket\Bin\Launcher::launch($config);

Run a local proxy

<?php
require_once __DIR__ . '/vendor/autoload.php';

$config = array(
    'local' => array(
        'server'      => '123.456.78.9',
        'port'        => '8388',
        'password'    => 'mypass',
        'encryption'  => 'aes-256-cfb',
        'local_port'  => '1086',
        'process_num' => 12,
    )
);

ShadowRocket\Bin\Launcher::launch($config);

This means we want to pass data to local proxy 127.0.0.1:1086 which will request proxy server 123.456.78.9:8388 for reply.

Fire your script up

Assuming your script is named as start.php, in which contains code to launch the Launcher.

To run as daemon:

php start.php start -d

To stop your script:

php start.php stop

To graceful restart:

php start.php reload

To check status:

php start.php status

To check connections:

php start.php connections

More docs

Want a client APP?