You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update README with CMake build instructions and ss-setup/ss-nat docs
Modernize build instructions to focus on CMake (the sole build system),
remove outdated autotools/backports references, and add documentation
for the ss-setup interactive TUI tool and the ss-nat transparent proxy
helper script with practical usage examples.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
You can build shadowsocks-libev and all its dependencies by script:
107
132
108
133
```bash
@@ -115,39 +140,6 @@ cd ~/build-area
115
140
For older systems, building `.deb` packages is not supported.
116
141
Please try to build and install directly from source. See the [Linux](#linux) section below.
117
142
118
-
**Note for Debian 8 (Jessie) users to build their own deb packages**:
119
-
120
-
We strongly encourage you to install shadowsocks-libev from `jessie-backports-sloppy`. If you insist on building from source, you will need to manually install libsodium from `jessie-backports-sloppy`, **NOT** libsodium in main repository.
121
-
122
-
For more info about backports, you can refer [Debian Backports](https://backports.debian.org).
123
-
124
-
```bash
125
-
cd shadowsocks-libev
126
-
sudo sh -c 'printf "deb http://deb.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list'
127
-
sudo sh -c 'printf "deb http://deb.debian.org/debian jessie-backports-sloppy main" >> /etc/apt/sources.list.d/jessie-backports.list'
**Note for Debian 9 (Stretch) users to build their own deb packages**:
136
-
137
-
We strongly encourage you to install shadowsocks-libev from `stretch-backports`. If you insist on building from source, you will need to manually install libsodium from `stretch-backports`, **NOT** libsodium in main repository.
138
-
139
-
For more info about backports, you can refer [Debian Backports](https://backports.debian.org).
140
-
141
-
```bash
142
-
cd shadowsocks-libev
143
-
sudo sh -c 'printf "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/stretch-backports.list'
@@ -214,60 +206,35 @@ In general, you need the following build dependencies:
214
206
* asciidoc (for documentation only)
215
207
* xmlto (for documentation only)
216
208
217
-
Notes: Fedora 26 libsodium version >= 1.0.12, so you can install via dnf install libsodium instead build from source.
209
+
If your system is too old to provide libmbedtls and libsodium (>= 1.0.4), you will need to either install those libraries manually or upgrade your system.
218
210
219
-
If your system is too old to provide libmbedtls and libsodium (later than **v1.0.8**), you will need to either install those libraries manually or upgrade your system.
211
+
Install build dependencies for your distribution:
220
212
221
-
If your system provides with those libraries, you **should not** install them from source. You should jump to this section and install them from the distribution repository instead.
You may need to manually install missing softwares.
270
-
271
238
### FreeBSD
272
239
#### Install
273
240
Shadowsocks-libev is available in FreeBSD Ports Collection. You can install it in either way, `pkg` or `ports`.
@@ -460,10 +427,170 @@ you may refer to the man pages of the applications, respectively.
460
427
461
428
[-v] Verbose mode.
462
429
463
-
## Transparent proxy
430
+
## Helper Scripts
431
+
432
+
### ss-setup
433
+
434
+
`ss-setup` is an interactive TUI (text user interface) tool for setting up shadowsocks-libev server and client configurations. It uses `whiptail` or `dialog` for the menu interface.
435
+
436
+
It is installed automatically by `make install` and can also be run directly from `scripts/ss-setup.sh`.
437
+
438
+
**Prerequisites:**`whiptail` or `dialog`, `openssl` (optional, for password generation)
439
+
440
+
#### Server setup (with systemd service)
441
+
442
+
Run as root for full functionality (config + systemd service installation):
443
+
444
+
```bash
445
+
sudo ss-setup
446
+
```
447
+
448
+
This launches an interactive menu that walks you through:
449
+
1. Choosing a config instance name
450
+
2. Setting the listen address and port (manual or random high port)
451
+
3. Selecting an AEAD cipher (chacha20-ietf-poly1305, aes-256-gcm, etc.)
452
+
4. Generating or entering a password
453
+
5. Configuring timeout, network mode (TCP/UDP), and TCP Fast Open
454
+
6. Optionally selecting a SIP003 plugin
455
+
7. Installing and starting a systemd service
456
+
457
+
The config is saved to `/etc/shadowsocks-libev/<name>.json` and a systemd template service `shadowsocks-libev-server@<name>.service` is created.
458
+
459
+
At the end, it displays a `ss://` URI you can import into clients.
460
+
461
+
#### Client config generation
462
+
463
+
Select "Generate ss-local client config" from the main menu. The wizard prompts for the remote server address, port, cipher, password, and local SOCKS5 port, then writes a JSON config:
464
+
465
+
```bash
466
+
# Run without root to generate config in the current directory
467
+
ss-setup
468
+
# Select: client -> fill in server details -> save
469
+
470
+
# Then start the client
471
+
ss-local -c ~/ss-client.json
472
+
```
473
+
474
+
#### Config-only mode (non-root)
475
+
476
+
When run without root, `ss-setup` skips service installation and plugin management, but still generates config files in the current directory:
477
+
478
+
```bash
479
+
ss-setup
480
+
# Config saved to ./config.json (in current directory)
481
+
# Start manually:
482
+
ss-server -c ./config.json
483
+
```
484
+
485
+
#### Service management
486
+
487
+
From the main menu, select "Manage running services" to start, stop, restart, enable/disable, or view logs for any configured instance:
488
+
489
+
```
490
+
sudo ss-setup
491
+
# Select: service -> pick instance -> start/stop/restart/logs
492
+
```
493
+
494
+
#### Plugin installation
495
+
496
+
Select "Install a SIP003 plugin" from the main menu (requires root). Supports automatic download of:
497
+
- simple-obfs (build from source or package manager)
498
+
- v2ray-plugin (GitHub release)
499
+
- xray-plugin (GitHub release)
500
+
- kcptun (GitHub release)
501
+
- Custom plugin binary
502
+
503
+
### ss-nat
504
+
505
+
`ss-nat` is a helper script that sets up iptables NAT rules for `ss-redir` to provide transparent TCP/UDP redirection. It is installed on Linux systems by `make install`.
506
+
507
+
**Prerequisites:** Linux with `iptables`, `ipset`, and optionally TPROXY kernel module for UDP
# 3. Point other devices' default gateway to this machine's LAN IP
582
+
# and set their DNS to a public resolver (e.g., 1.1.1.1 or 8.8.8.8)
583
+
584
+
# To tear down:
585
+
sudo ss-nat -f
586
+
```
587
+
588
+
## Transparent proxy (manual iptables)
464
589
465
590
The latest shadowsocks-libev has provided a *redir* mode. You can configure your Linux-based box or router to proxy all TCP traffic transparently, which is handy if you use an OpenWRT-powered router.
466
591
592
+
Note: For most use cases, [`ss-nat`](#ss-nat) above is simpler than writing iptables rules manually.
0 commit comments