PHPackages                             18230/shadowsocks-local - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. 18230/shadowsocks-local

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

18230/shadowsocks-local
=======================

Pure PHP Shadowsocks client with a SOCKS5 frontend.

v0.2.0(3mo ago)10MITPHPPHP ^8.2CI passing

Since Mar 30Pushed 3mo agoCompare

[ Source](https://github.com/18230/php-shadowsocks-client)[ Packagist](https://packagist.org/packages/18230/shadowsocks-local)[ Docs](https://github.com/18230/php-shadowsocks-client)[ RSS](/packages/18230-shadowsocks-local/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)Dependencies (5)Versions (4)Used By (0)

php-shadowsocks-client
======================

[](#php-shadowsocks-client)

[![Ubuntu CI](https://camo.githubusercontent.com/12d6dc0bab216d5b328d301663de02f9715aaad5bbc700fab40d49c784d520ff/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f31383233302f7068702d736861646f77736f636b732d636c69656e742f7562756e74752d63692e796d6c3f6272616e63683d6d61696e266c6162656c3d7562756e74752532306369)](https://github.com/18230/php-shadowsocks-client/actions/workflows/ubuntu-ci.yml)[![Release](https://camo.githubusercontent.com/b19bac7a6e094c25de5f0b8459c3bac577a770fdc85b688e205c2b4408168fda/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f31383233302f7068702d736861646f77736f636b732d636c69656e743f6c6162656c3d72656c65617365)](https://github.com/18230/php-shadowsocks-client/tags)[![Packagist Version](https://camo.githubusercontent.com/bc099456488b6413216d32d851c4f3e8cffe7694cdbead3141e73b9acaf41051/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f31383233302f7068702d736861646f77736f636b732d636c69656e743f6c6162656c3d7061636b6167697374)](https://packagist.org/packages/18230/php-shadowsocks-client)[![Packagist Downloads](https://camo.githubusercontent.com/cd2821aef6a551e497375144b09c2344b2f50be709a326ab3d6a768575274107/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f31383233302f7068702d736861646f77736f636b732d636c69656e743f6c6162656c3d646f776e6c6f616473)](https://packagist.org/packages/18230/php-shadowsocks-client)[![License](https://camo.githubusercontent.com/64457b036c1c8cb71e018a218c2b804154dbb77478dfc4bee7399529a5c5eb68/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f31383233302f7068702d736861646f77736f636b732d636c69656e74)](LICENSE)[![PHP](https://camo.githubusercontent.com/5ed842996550cad148e16d3ad4738491b8319d2fbf7bba88eeeee0cb4bf9b736/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d373737626234)](https://www.php.net/)

[中文文档](README.zh-CN.md)

`php-shadowsocks-client` is a pure-PHP Shadowsocks client package. It exposes a local SOCKS5 endpoint through the bundled `ss-local` runtime and relays TCP traffic to a remote Shadowsocks server by using Workerman as the long-running runtime.

Features
--------

[](#features)

- PHP 8.2+
- Windows, Linux, and macOS
- Composer package with a CLI entrypoint
- Pure PHP SOCKS5 frontend and Shadowsocks TCP relay
- `aes-256-gcm`
- YAML, JSON, and `ss://` node parsing
- Reusable `ProxyService` helpers for application code
- Laravel and ThinkPHP integration entry points
- Cross-platform startup scripts for development and production
- GitHub Actions Ubuntu CI workflow for Linux validation

Current Scope
-------------

[](#current-scope)

Implemented:

- SOCKS5 `CONNECT`
- Shadowsocks TCP relay
- CLI startup command
- TLS helper objects for PHP `curl` and Guzzle
- Structured logging and basic runtime guards

Not implemented yet:

- UDP relay
- SIP003 plugins
- AEAD-2022 methods
- Additional ciphers beyond `aes-256-gcm`

Installation
------------

[](#installation)

Install from Packagist:

```
composer require 18230/php-shadowsocks-client
```

For local development in this repository:

```
composer install
```

Quick Start
-----------

[](#quick-start)

Start with explicit options:

```
php bin/ss-local \
  --server=your-node.example.com \
  --port=18001 \
  --cipher=aes-256-gcm \
  --password=your-password \
  --listen=127.0.0.1:1080
```

Start with inline YAML:

```
php bin/ss-local --node="{ name: 'SG 01', type: ss, server: your-node.example.com, port: 18001, cipher: aes-256-gcm, password: your-password, udp: true }"
```

Start with a config file:

```
php bin/ss-local --config=examples/node.example.yaml
```

Validate the runtime and configuration before you start:

```
php bin/ss-local doctor --config=examples/node.example.yaml
```

Check available options:

```
php bin/ss-local --help
```

Application Usage
-----------------

[](#application-usage)

### PHP curl

[](#php-curl)

```
