The Light-SS Pool HTTP API provides RESTful endpoints for managing proxy instances, subscriptions, and monitoring.
http://127.0.0.1:9090
(Configurable via server.listen in config.yaml)
If a token is configured in server.token, all API requests (except /health) must include a Bearer token in the Authorization header:
Authorization: Bearer YOUR_TOKEN_HERE
All API responses follow this JSON format:
{
"success": true,
"data": { ... },
"error": ""
}success: Boolean indicating if the request succeededdata: Response data (present on success)error: Error message (present on failure)
Check API server health status.
Response:
{
"success": true,
"data": {
"status": "ok",
"time": "2025-12-02T04:22:00Z"
}
}List all proxy instances.
Response:
{
"success": true,
"data": {
"instances": [
{
"id": "instance-001",
"name": "HK Node 01",
"source": "subscription",
"enabled": true,
"state": "running",
"pid": 12345,
"uptime_ms": 3600000,
"proxy_addr": "127.0.0.1:10800",
"server_addr": "example.com:8388",
"cipher": "AEAD_CHACHA20_POLY1305"
}
]
}
}Instance States:
stopped: Instance is not runningstarting: Instance is starting uprunning: Instance is running normallyfailed: Instance failed to start or crashed
Manually add a new proxy instance.
Request Body:
{
"id": "my-instance",
"name": "My Custom Proxy",
"enabled": true,
"shadowsocks": {
"server": "example.com:8388",
"password": "your-password",
"cipher": "AEAD_CHACHA20_POLY1305",
"timeout": 300,
"plugin": "simple-obfs",
"plugin_opts": {
"obfs": "http",
"obfs-host": "www.bing.com"
}
},
"proxies": "127.0.0.1:10800"
}Fields:
id(required): Unique instance identifiername(required): Display nameenabled: Enable instance on creation (default: false)shadowsocks.server(required): SS server address:portshadowsocks.password(required): SS passwordshadowsocks.cipher: Encryption cipher (default: AEAD_CHACHA20_POLY1305)shadowsocks.timeout: Connection timeout in seconds (default: 300)shadowsocks.plugin: Plugin name (e.g., "simple-obfs")shadowsocks.plugin_opts: Plugin options (key-value map)proxies(required): Local proxy listen address
Response:
{
"success": true,
"data": {
"id": "my-instance"
}
}or
Get detailed status of a specific instance.
Response:
{
"success": true,
"data": {
"id": "instance-001",
"name": "HK Node 01",
"source": "subscription",
"enabled": true,
"state": "running",
"pid": 12345,
"uptime_ms": 3600000,
"proxy_addr": "127.0.0.1:10800",
"server_addr": "example.com:8388",
"cipher": "AEAD_CHACHA20_POLY1305"
}
}For failed instances, additional fields are included:
{
"success": true,
"data": {
"id": "instance-002",
"state": "failed",
"error": "process exited with code 1",
"failure_count": 3,
...
}
}Start a stopped instance.
Response:
{
"success": true,
"data": {
"status": "started"
}
}Stop a running instance.
Response:
{
"success": true,
"data": {
"status": "stopped"
}
}Restart an instance (stop then start).
Response:
{
"success": true,
"data": {
"status": "restarted"
}
}Reload instance configuration and restart if running.
Response:
{
"success": true,
"data": {
"status": "reloaded"
}
}Enable an instance (allows it to be started).
Response:
{
"success": true,
"data": {
"status": "enabled"
}
}Disable an instance (prevents it from starting).
Response:
{
"success": true,
"data": {
"status": "disabled"
}
}Update instance configuration.
Request Body:
{
"name": "New Instance Name"
}Response:
{
"success": true,
"data": {
"status": "updated"
}
}Remove an instance from the pool.
Response:
{
"success": true,
"data": {
"status": "deleted"
}
}List all subscriptions.
Response:
{
"success": true,
"data": {
"subscriptions": [
{
"id": "my-sub",
"name": "My Subscription",
"url": "https://example.com/subscription",
"enabled": true,
"update_interval": 86400,
"last_updated": "2025-12-02T04:00:00Z"
}
]
}
}Add a new subscription.
Request Body:
{
"id": "my-sub",
"name": "My Subscription",
"url": "https://example.com/subscription",
"enabled": true,
"update_interval": 86400
}Fields:
id(required): Unique subscription identifiername(required): Display nameurl(required): Subscription URLenabled: Enable subscription (default: false)update_interval: Auto-update interval in seconds (default: 86400 = 24h)
Response:
{
"success": true,
"data": {
"id": "my-sub"
}
}or
Get subscription details.
Response:
{
"success": true,
"data": {
"id": "my-sub",
"name": "My Subscription",
"url": "https://example.com/subscription",
"enabled": true,
"update_interval": 86400,
"last_updated": "2025-12-02T04:00:00Z"
}
}Fetch and parse subscription URL to update instances.
Response:
{
"success": true,
"data": {
"status": "synced"
}
}This will:
- Fetch subscription URL
- Parse Shadowsocks nodes
- Create/update instances in the pool
- Reload pool manager with new instances
Enable a subscription.
Response:
{
"success": true,
"data": {
"status": "enabled"
}
}Disable a subscription.
Response:
{
"success": true,
"data": {
"status": "disabled"
}
}Update subscription configuration.
Request Body:
{
"name": "New Subscription Name",
"url": "https://new-url.com/subscription",
"update_interval": 43200
}All fields are optional. Only provided fields will be updated.
Response:
{
"success": true,
"data": {
"status": "updated"
}
}Remove a subscription.
Response:
{
"success": true,
"data": {
"status": "deleted"
}
}Test all servers in a subscription without starting instances. Tests connection, latency, and optionally download speed.
Request Body:
{
"latency_only": false,
"force_refresh": false,
"min_speed_mbps": 0,
"max_latency_ms": 0
}Fields:
latency_only: If true, only test latency (skip speed test) - much faster (default: false)force_refresh: Force new test, ignore cache (default: false)min_speed_mbps: Filter servers with minimum speed in Mbps (default: 0 = no filter)max_latency_ms: Filter servers with maximum latency in milliseconds (default: 0 = no filter)
Response:
{
"success": true,
"data": {
"subscription_id": "my-sub",
"subscription_name": "My Subscription",
"test_time": "2025-12-02T10:00:00Z",
"total_servers": 310,
"tested_servers": 310,
"working_servers": 302,
"failed_servers": 8,
"cached": false,
"cache_expires": "2025-12-02T12:00:00Z",
"test_duration_seconds": 465.5,
"results": [
{
"server": "example.com:8388",
"name": "HK Node 01",
"cipher": "aes-256-gcm",
"success": true,
"latency_ms": 36,
"download_speed_mbps": 193.98,
"rank": 1,
"plugin": "simple-obfs",
"test_time": "2025-12-02T10:00:00Z"
}
],
"summary": {
"avg_latency_ms": 85,
"avg_speed_mbps": 75.5,
"fastest_server": "example.com:8388",
"lowest_latency_server": "example2.com:8388"
}
}
}Test Features:
- Tests up to 1000 servers per subscription
- 10 concurrent tests for performance
- 15-second timeout per server
- 2-hour result caching
- Results ranked by download speed
Retrieve cached test results without running a new test.
Response:
{
"success": true,
"data": {
"subscription_id": "my-sub",
"cached": true,
"cache_expires": "2025-12-02T12:00:00Z",
"total_servers": 310,
"working_servers": 302,
"failed_servers": 8,
"results": [...]
}
}If no cached results exist:
{
"success": false,
"error": "no cached test results found"
}Clear cached test results for a subscription, forcing next test to be fresh.
Response:
{
"success": true,
"data": {
"status": "cache cleared"
}
}Test a Shadowsocks server without creating an instance. Useful for validating server configurations before deployment.
Request Body:
{
"server": "example.com:8388",
"password": "your-password",
"cipher": "aes-256-gcm",
"timeout": 15,
"latency_only": false,
"plugin": "simple-obfs",
"plugin_opts": {
"obfs": "http",
"obfs-host": "bing.com"
}
}Fields:
server(required): Server address with portpassword(required): Server passwordcipher(required): Encryption ciphertimeout: Test timeout in seconds (default: 15)latency_only: Only test latency, skip speed test (default: false)plugin: Plugin name (e.g., "simple-obfs")plugin_opts: Plugin options map
Response:
{
"success": true,
"data": {
"server": "example.com:8388",
"cipher": "aes-256-gcm",
"success": true,
"latency_ms": 36,
"download_speed_mbps": 15.57,
"timestamp": "2025-12-02T10:00:00Z"
}
}Failed Test Response:
{
"success": true,
"data": {
"server": "example.com:8388",
"cipher": "aes-256-gcm",
"success": false,
"error": "connection timeout",
"timestamp": "2025-12-02T10:00:00Z"
}
}Get overall pool statistics.
Response:
{
"success": true,
"data": {
"total": 10,
"running": 7,
"stopped": 2,
"failed": 1,
"enabled": 9,
"disabled": 1
}
}Get pool configuration.
Response:
{
"success": true,
"data": {
"listen": "127.0.0.1:9090",
"light_ss_binary": "./lss",
"data_path": "./data",
"monitor_enabled": true,
"auto_restart": true
}
}Start all enabled instances.
Response:
{
"success": true,
"data": {
"status": "started"
}
}Stop all running instances.
Response:
{
"success": true,
"data": {
"status": "stopped"
}
}Get health monitoring summary.
Response:
{
"success": true,
"data": {
"total": 10,
"healthy": 7,
"unhealthy": 3,
"running": 7,
"stopped": 2,
"failed": 1,
"starting": 0,
"enabled": 9,
"checked_at": "2025-12-02T04:22:00Z"
}
}Get monitoring service status.
Response:
{
"success": true,
"data": {
"enabled": true,
"running": true,
"last_check_at": "2025-12-02T04:22:00Z"
}
}Error responses follow the standard format:
{
"success": false,
"error": "error message here"
}200 OK: Request succeeded400 Bad Request: Invalid request parameters401 Unauthorized: Missing or invalid authentication token404 Not Found: Resource not found405 Method Not Allowed: HTTP method not supported for endpoint500 Internal Server Error: Server error
Add a subscription:
curl -X POST http://127.0.0.1:9090/api/subs/add \
-H "Content-Type: application/json" \
-d '{
"id": "my-sub",
"name": "My Subscription",
"url": "https://example.com/subscription",
"enabled": true
}'Sync subscription:
curl -X POST http://127.0.0.1:9090/api/subs/my-sub/syncStart an instance:
curl -X POST http://127.0.0.1:9090/api/inst/instance-001/startGet pool status:
curl http://127.0.0.1:9090/api/pool/statusTest subscription servers:
curl -X POST http://127.0.0.1:9090/api/subs/my-sub/test \
-H "Content-Type: application/json" \
-d '{
"latency_only": true,
"force_refresh": false
}'Get cached test results:
curl http://127.0.0.1:9090/api/subs/my-sub/test-resultsClear test cache:
curl -X DELETE http://127.0.0.1:9090/api/subs/my-sub/test-cacheTest a server manually:
curl -X POST http://127.0.0.1:9090/api/test \
-H "Content-Type: application/json" \
-d '{
"server": "example.com:8388",
"password": "your-password",
"cipher": "aes-256-gcm",
"latency_only": false,
"plugin": "simple-obfs",
"plugin_opts": {
"obfs": "http",
"obfs-host": "bing.com"
}
}'If token authentication is enabled:
curl -X POST http://127.0.0.1:9090/api/subs/my-sub/sync \
-H "Authorization: Bearer YOUR_TOKEN_HERE"The lspc CLI client provides a convenient wrapper around the API:
# Add subscription
./lspc subs add my-sub -name "My Subscription" -url "https://..." -enabled
# Sync subscription
./lspc subs sync my-sub
# Start instance
./lspc inst start instance-001
# Get pool status
./lspc pool status
# Test subscription servers
./lspc subs test my-sub --latency-only
# View test results
./lspc subs test-results my-sub
# Clear test cache
./lspc subs test-clear my-sub
# Test a server manually
./lspc test --server example.com:8388 --password mypass --cipher aes-256-gcm --latency-onlySee the main README for more CLI examples.