@@ -235,9 +235,84 @@ This setup:
235235- Enables developers to access environments without direct network exposure
236236- Maps remote services to different local ports for easy identification
237237
238+ ## High Availability and Load Balancing
239+
240+ ### Example 14: Multi-Backend Server Load Balancing
241+
242+ Use target address groups for even traffic distribution and automatic failover:
243+
244+ ``` bash
245+ # Server side: Configure 3 backend web servers
246+ nodepass " server://0.0.0.0:10101/web1.internal:8080,web2.internal:8080,web3.internal:8080?mode=2&tls=1&log=info"
247+
248+ # Client side: Connect to server
249+ nodepass " client://server.example.com:10101/127.0.0.1:8080?log=info"
250+ ```
251+
252+ This configuration:
253+ - Automatically distributes traffic across 3 backend servers using round-robin for load balancing
254+ - Automatically switches to other available servers when one backend fails
255+ - Automatically resumes sending traffic to recovered servers
256+ - Uses TLS encryption to secure the tunnel
257+
258+ ### Example 15: Database Primary-Replica Failover
259+
260+ Configure primary and replica database instances for high availability access:
261+
262+ ``` bash
263+ # Client side: Configure primary and replica database addresses (single-end forwarding mode)
264+ nodepass " client://127.0.0.1:3306/db-primary.local:3306,db-secondary.local:3306?mode=1&log=warn"
265+ ```
266+
267+ This setup:
268+ - Prioritizes connections to primary database, automatically switches to replica on primary failure
269+ - Single-end forwarding mode provides high-performance local proxy
270+ - Application requires no modification for transparent failover
271+ - Logs only warnings and errors to reduce output
272+
273+ ### Example 16: API Gateway Backend Pool
274+
275+ Configure multiple backend service instances for an API gateway:
276+
277+ ``` bash
278+ # Server side: Configure 4 API service instances
279+ nodepass " server://0.0.0.0:10101/api1.backend:8080,api2.backend:8080,api3.backend:8080,api4.backend:8080?mode=2&tls=1&rate=200&slot=5000"
280+
281+ # Client side: Connect from API gateway
282+ nodepass " client://apigateway.example.com:10101/127.0.0.1:8080?rate=100&slot=2000"
283+ ```
284+
285+ This configuration:
286+ - 4 API service instances form backend pool with round-robin request distribution
287+ - Server limits bandwidth to 200 Mbps with maximum 5000 concurrent connections
288+ - Client limits bandwidth to 100 Mbps with maximum 2000 concurrent connections
289+ - Single instance failure doesn't affect overall service availability
290+
291+ ### Example 17: Geo-Distributed Services
292+
293+ Configure multi-region service nodes to optimize network latency:
294+
295+ ``` bash
296+ # Server side: Configure multi-region nodes
297+ nodepass " server://0.0.0.0:10101/us-west.service:8080,us-east.service:8080,eu-central.service:8080?mode=2&log=debug"
298+ ```
299+
300+ This setup:
301+ - Configures 3 service nodes in different regions
302+ - Round-robin algorithm automatically distributes traffic across regions
303+ - Debug logging helps analyze traffic distribution and failure scenarios
304+ - Suitable for globally distributed application scenarios
305+
306+ ** Target Address Group Best Practices:**
307+ - ** Address Count** : Recommend configuring 2-5 addresses; too many increases failure detection time
308+ - ** Health Checks** : Ensure backend services have their own health check mechanisms
309+ - ** Port Consistency** : All addresses use the same port or explicitly specify port for each address
310+ - ** Monitoring & Alerts** : Configure monitoring systems to track failover events
311+ - ** Testing & Validation** : Verify failover and load balancing behavior in test environments before deployment
312+
238313## PROXY Protocol Integration
239314
240- ### Example 14 : Load Balancer Integration with PROXY Protocol
315+ ### Example 18 : Load Balancer Integration with PROXY Protocol
241316
242317Enable PROXY protocol support for integration with load balancers and reverse proxies:
243318
@@ -256,7 +331,7 @@ This configuration:
256331- Compatible with HAProxy, Nginx, and other PROXY protocol aware services
257332- Useful for maintaining accurate access logs and IP-based access controls
258333
259- ### Example 15 : Reverse Proxy Support for Web Applications
334+ ### Example 19 : Reverse Proxy Support for Web Applications
260335
261336Enable web applications behind NodePass to receive original client information:
262337
@@ -280,7 +355,7 @@ This setup:
280355- Supports compliance requirements for connection auditing
281356- Works with web servers that support PROXY protocol (Nginx, HAProxy, etc.)
282357
283- ### Example 16 : Database Access with Client IP Preservation
358+ ### Example 20 : Database Access with Client IP Preservation
284359
285360Maintain client IP information for database access logging and security:
286361
@@ -307,7 +382,7 @@ Benefits:
307382
308383## Container Deployment
309384
310- ### Example 17 : Containerized NodePass
385+ ### Example 21 : Containerized NodePass
311386
312387Deploy NodePass in a Docker environment:
313388
@@ -342,7 +417,7 @@ This configuration:
342417
343418## Master API Management
344419
345- ### Example 18 : Centralized Management
420+ ### Example 22 : Centralized Management
346421
347422Set up a central controller for multiple NodePass instances:
348423
@@ -379,7 +454,7 @@ This setup:
379454- Offers a RESTful API for automation and integration
380455- Includes a built-in Swagger UI at http://localhost:9090/api/v1/docs
381456
382- ### Example 19 : Custom API Prefix
457+ ### Example 23 : Custom API Prefix
383458
384459Use a custom API prefix for the master mode:
385460
@@ -398,7 +473,7 @@ This allows:
398473- Custom URL paths for security or organizational purposes
399474- Swagger UI access at http://localhost:9090/admin/v1/docs
400475
401- ### Example 20 : Real-time Connection and Traffic Monitoring
476+ ### Example 24 : Real-time Connection and Traffic Monitoring
402477
403478Monitor instance connection counts and traffic statistics through the master API:
404479
0 commit comments