By Admin on Tuesday, 06 October 2020
Category: All

DataSnap with WebSocket and HTTP/2

​From sgcWebSockets 4.4.3, you can replace your DataSnap server application by our WebSockets server and take advantage of new features like:



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).

Related Posts