Here’s a hardened ssserver configuration that supports IPv6, sets a timeout of 300 seconds, and includes other relevant options for optimal performance. The configuration uses strong encryption, enables TCP and UDP modes, and includes some best practices for security and performance.
Example Hardened ssserver Configuration (JSON)
json
{
"server": "[Redacted IPAddress]", // Listen on both IPv4 and IPv6
"server_port": 8388, // Default port, change if required
"password": "generate-a-strong-password-here", // Replace with a strong, secure password
"method": "aes-256-gcm", // Strong encryption method
"timeout": 300, // Timeout in seconds
"mode": "tcp_and_udp", // Enable both TCP and UDP
"fast_open": true, // Enable TCP Fast Open for better performance
"no_delay": true, // Disable Nagle's algorithm to reduce latency
"keep_alive": 60, // Keep-alive interval in seconds
"ipv6_first": true, // Prioritize IPv6 when both IPv4 and IPv6 are available
"mptcp": false, // Disable MPTCP unless explicitly needed
"dns": "[Redacted IPAddress]", // Set a reliable DNS server, if needed
"balancer": {
"max_server_rtt": 500, // Optional: Define max RTT for server balancing
"check_interval": 60, // Optional: Interval for health checks
"check_best_interval": 300 // Optional: Interval to re-evaluate the best server
},
"acl": null, // Optional: Add access control lists if needed
"security": {
"replay_attack": {
"policy": "strict" // Strict policy to mitigate replay attacks
}
}
}
Explanation of Key Options:
server:
[Redacted IPAddress] allows the server to listen on both IPv6 and IPv4. If you only want IPv6, use [[Redacted IPAddress]].
method:
Use a strong AEAD cipher like aes-256-gcm, chacha20-ietf-poly1305, or aes-128-gcm. Avoid deprecated ciphers.
timeout:
A value of 300 seconds ensures idle connections are closed after 5 minutes, balancing performance and resource usage.
mode:
tcp_and_udp allows both TCP and UDP traffic, making it versatile for various use cases.
fast_open:
Enabling TCP Fast Open reduces latency for repeated TCP connections.
no_delay:
Disables Nagle's algorithm, which is particularly useful for latency-sensitive applications.
keep_alive:
A keep-alive interval of 60 seconds ensures idle connections are kept active without frequent disconnections.
ipv6_first:
Prioritizes IPv6 connections when both IPv4 and IPv6 are available.
mptcp:
Disabled unless explicitly required. Multipath TCP is best used in specific network setups.
dns:
Setting a reliable DNS server like [Redacted IPAddress] (Google's public DNS) ensures DNS queries are resolved smoothly.
balancer:
Optional configuration to balance traffic across multiple servers based on their response times (RTT) and health.
security:
Replay attack policies ensure that malicious attempts to reuse old packets are mitigated. The strict policy offers the highest protection.
Additional Notes:
Encryption Key:
Use a strong, randomly generated password. This can be generated with a tool like openssl rand -base64 32 or the ssservice genkey command.
Port Configuration:
Ensure the server_port is open and properly forwarded in your firewall for both TCP and UDP traffic.
System Tweaks for Performance:
Optimize system settings for high-performance networking:
Enable TCP fast open: sysctl -w net.ipv4.tcp_fastopen=3.
Increase file descriptor limits: ulimit -n 65535.
Adjust kernel parameters for better networking (e.g., net.core.rmem_max, net.core.wmem_max).
DNS Configuration:
You can also add a dns section to configure advanced DNS settings, particularly useful if using FakeDNS or local-dns features.
This configuration ensures a hardened, high-performance Shadowsocks server setup that supports IPv6 while optimizing for modern networking requirements. Adjust the options as necessary based on your specific use case.
Dataset releases
Not yet included in a published release.
acl:
Add Access Control Lists (ACLs) to restrict or manage access if needed.