By Admin on Tuesday, 05 March 2024
Category: All

Load Balancer HTTP & WebSocket Protocols

​The component TsgcWebSocketLoadBalancerServer has been improved for sgcWebSockets 2024.3.0 version. Now supports the HTTP Protocol, previously only supported WebSockets, and has a couple of new events to fine-tune the HTTP Requests. The Load Balancer server now descends from the TsgcWebSocketHTTPServer, so inherits all the methods and properties of this.


Load Server Configuration

The Load Balancer server it's a descendant of TsgcWebSocketHTTPServer, so read the documentation about the TsgcWebSocketHTTPServer to know how to configure it.

Additionally, the Load Balancer has the property LoadBalancer, which has the following properties:

​Backup Server Configuration

The Backup Servers (the servers behind the load balancer) can be a TsgcWebSocketServer, TsgcWebSocketHTTPServer or a DataSnap Server.

Those servers have a property called LoadBalancer where you can configure the connection between the LoadBalancer Server and the Backup Servers.

Sample

Find below a link to download a compiled demo for Windows which shows how put a Load Balancing Server which forward the HTTP requests randomly to 3 servers. 

Related Posts