DataSnap — WebBroker Bridge (WebSockets)
TsgcWSHTTPWebBrokerBridgeServer — pure-Delphi WebBroker / DataSnap host with WebSocket transport on top of TsgcWebSocketHTTPServer.
TsgcWSHTTPWebBrokerBridgeServer — pure-Delphi WebBroker / DataSnap host with WebSocket transport on top of TsgcWebSocketHTTPServer.
TsgcWSHTTPWebBrokerBridgeServer make use of TIdHttpWebBrokerBridge as server base and is useful if you want to use a single server for DataSnap, HTTP and WebSocket connections.
TsgcWSHTTPWebBrokerBridgeServer| Standards & specs | WebSocket Protocol — RFC 6455 |
| Component class | TsgcWSHTTPWebBrokerBridgeServer (unit sgcWebSocket_HTTP_WebBrokerBridge) |
| Frameworks | VCL, FireMonkey, Lazarus / FPC |
| Platforms | Windows, macOS, Linux, iOS, Android |
The principal published / public properties used to configure and drive the component. Consult the online help for the full list.
DefaultPort | Published or public property used to configure or query the component. |
HTTPWebBrokerBridge | Published or public property used to configure or query the component. |
NotifyEvents | Published or public property used to configure or query the component. |
OnCommandRequest | Published or public property used to configure or query the component. |
OnBeforeCommand | Published or public property used to configure or query the component. |
OnCommandGet | Published or public property used to configure or query the component. |
OnCommandOther | Published or public property used to configure or query the component. |
OnCreateSession | Published or public property used to configure or query the component. |
OnInvalidSession | Published or public property used to configure or query the component. |
OnSessionEnd | Published or public property used to configure or query the component. |
The principal public methods exposed by the component.
PushPromiseAddPreLoadLinks() | Public procedure exposed by the component. |
PushPromiseRemovePreLoadLinks() | Public procedure exposed by the component. |
Drop the component on a form, configure the properties below and activate it. The snippet that follows shows the typical Load Balancer configuration sourced from the online help.
procedure TWebModule1.WebModuleBeforeDispatch(Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); begin Response.SetCustomHeader('Access-Control-Allow-Origin','*'); if Trim(Request.GetFieldByName('Access-Control-Request-Headers')) <> '' then begin Response.SetCustomHeader('Access-Control-Allow-Headers', Request.GetFieldByName('Access-Control-Request-Headers')); Handled := True; end; if FServerFunctionInvokerAction <> nil then FServerFunctionInvokerAction.Enabled := AllowServerFunctionInvoker; end;
void __fastcall TWebModule1::WebModuleBeforeDispatch(TObject *Sender, TWebRequest *Request, TWebResponse *Response, bool &Handled) { Response->SetCustomHeader("Access-Control-Allow-Origin", "*"); if (Trim(Request->GetFieldByName("Access-Control-Request-Headers")) != "") { Response->SetCustomHeader("Access-Control-Allow-Headers", Request->GetFieldByName("Access-Control-Request-Headers")); Handled = true; } if (FServerFunctionInvokerAction != nullptr) { FServerFunctionInvokerAction->Enabled = AllowServerFunctionInvoker; } }
void WebModuleBeforeDispatch(object Sender, TWebRequest Request, TWebResponse Response, ref bool Handled) { Response.SetCustomHeader("Access-Control-Allow-Origin", "*"); if (Request.GetFieldByName("Access-Control-Request-Headers").Trim() != "") { Response.SetCustomHeader("Access-Control-Allow-Headers", Request.GetFieldByName("Access-Control-Request-Headers")); Handled = true; } if (FServerFunctionInvokerAction != null) { FServerFunctionInvokerAction.Enabled = AllowServerFunctionInvoker; } }
Every external claim links back to a primary source. The online-help references decode the canonical deep-link the company maintains for this component.
Demos\40.DataSnap