From sgcWebSockets 4.4.3, you can replace your DataSnap server application by our WebSockets server and take advantage of new features like:
- WebSocket Protocol
- HTTP/2 Protocol
- IOCP
There are 3 different types of server that you can use as a replacement of TIdHTTPWebBrokerBridge default Indy server.
Server | Main Features | Description |
TsgcWSHTTPWebBrokerBridgeServer | WebSocket Protocol HTTP 1.* Protocol XHR Protocol IOCP |
Based on Indy library, supports WebSocket and HTTP protocols on the same port. IOCP can be enabled too. |
TsgcWSHTTP2WebBrokerBridgeServer | WebSocket Protocol HTTP 1.* Protocol HTTP/2 Protocol XHR Protocol IOCP | Based on Indy library, supports WebSocket and HTTP/2 protocols on the same port. IOCP can be enabled too. |
TsgcWSServer_HTTPAPI_WebBrokerBridge | WebSocket Protocol HTTP 1.* Protocol HTTP/2 Protocol XHR Protocol IOCP | Based on HTTP.SYS Microfost API, supports WebSocket and HTTP/2 protocols on the same port. IOCP is used by default. Recommended for best performance. |
Using any of these servers, you can use HTTP and WebSocket protocol using the same listening port. You can dispatch custom http requests using OnHTTPRequest event available on any of these servers.
Sample Code
In order to use any of these servers, you must replace the default Indy WebBrokerBridge server and set the required properties in order to run it.
Check the following code which replace the default server and make use of TsgcWSHTTPWebBrokerBridgeServer (supports HTTP + WebSocket protocols).
You can download a compiled demo showing how these Server works from the following link
DataSnap WebSockets HTTP/2
DataSnap WebSockets HTTP/2