TsgcWebSocketServer_HTTPAPI › Events
Events you can handle, grouped by purpose, followed by the full alphabetical list.
| Name | Description |
|---|---|
| OnStartup | Fires after the HTTP API server has started and is ready to accept connections. |
| OnShutdown | Fires after the HTTP API server has stopped and no more requests are accepted. |
| OnBeforeBinding | Fires before the server binds to the configured URL, so the list of bindings can be inspected or customized. |
| OnTCPConnect | Fires after a client connects at TCP level and before the WebSocket handshake, so the connection can be accepted or rejected. |
| OnConnect | Fires every time a WebSocket connection is established with a client. |
| OnDisconnect | Fires every time a WebSocket connection with a client is dropped. |
| OnHandshake | Fires after the handshake is evaluated on the server side and before the response is sent. |
| OnError | Fires whenever a WebSocket protocol error occurs, such as a mal-formed handshake. |
| OnException | Fires whenever an unhandled exception is raised while processing a client connection. |
| OnUnknownProtocol | Not currently supported by the HTTP API server; declared for API compatibility with TsgcWebSocketServer. |
| Name | Description |
|---|---|
| OnMessage | Fires every time a client sends a text message and it is received by the server. |
| OnBinary | Fires every time a client sends a binary message and it is received by the server. |
| OnFragmented | Fires when a fragment of a message is received (only when Options.FragmentedMessages is frgAll or frgOnlyFragmented). |
| Name | Description |
|---|---|
| OnHTTPRequest | Fires when the server receives an HTTP request so the application can build the response. |
| OnBeforeForwardHTTP | Fires before an HTTP request is dispatched so it can be forwarded (reverse-proxied) to another HTTP server. |
| OnAfterForwardHTTP | Fires after an HTTP request has been forwarded so the application can inspect the result or an error returned by the upstream server. |
| Name | Description |
|---|---|
| OnHTTPUploadBeforeSaveFile | Fires before a file extracted from a multipart/form-data upload is saved to disk so the name and path can be customized. |
| OnHTTPUploadAfterSaveFile | Fires after a file extracted from a multipart/form-data upload has been saved to disk. |
| OnHTTPUploadReadInput | Fires when the multipart/form-data decoder reads a non-file input field so its value can be captured. |
| OnHTTPUploadBeforeCreatePostStream | Fires after the request headers have been read and before the POST stream is created so the upload can be accepted or rejected. |
| Name | Description |
|---|---|
| OnBeforeHeartBeat | Fires before each HeartBeat ping so the application can implement a custom keep-alive. |
| OnAsynchronous | Fires when an asynchronous send operation initiated by the HTTP API server has completed. |
| Name | Description |
|---|---|
| OnAuthentication | Fires when authentication is enabled so the application can check user and password and accept or reject the connection. |
| Name | Description |
|---|---|
| OnAfterForwardHTTP | Fires after an HTTP request has been forwarded so the application can inspect the result or an error returned by the upstream server. |
| OnAsynchronous | Fires when an asynchronous send operation initiated by the HTTP API server has completed. |
| OnAuthentication | Fires when authentication is enabled so the application can check user and password and accept or reject the connection. |
| OnBeforeBinding | Fires before the server binds to the configured URL, so the list of bindings can be inspected or customized. |
| OnBeforeForwardHTTP | Fires before an HTTP request is dispatched so it can be forwarded (reverse-proxied) to another HTTP server. |
| OnBeforeHeartBeat | Fires before each HeartBeat ping so the application can implement a custom keep-alive. |
| OnBinary | Fires every time a client sends a binary message and it is received by the server. |
| OnConnect | Fires every time a WebSocket connection is established with a client. |
| OnDisconnect | Fires every time a WebSocket connection with a client is dropped. |
| OnError | Fires whenever a WebSocket protocol error occurs, such as a mal-formed handshake. |
| OnException | Fires whenever an unhandled exception is raised while processing a client connection. |
| OnFragmented | Fires when a fragment of a message is received (only when Options.FragmentedMessages is frgAll or frgOnlyFragmented). |
| OnHandshake | Fires after the handshake is evaluated on the server side and before the response is sent. |
| OnHTTPRequest | Fires when the server receives an HTTP request so the application can build the response. |
| OnHTTPUploadAfterSaveFile | Fires after a file extracted from a multipart/form-data upload has been saved to disk. |
| OnHTTPUploadBeforeCreatePostStream | Fires after the request headers have been read and before the POST stream is created so the upload can be accepted or rejected. |
| OnHTTPUploadBeforeSaveFile | Fires before a file extracted from a multipart/form-data upload is saved to disk so the name and path can be customized. |
| OnHTTPUploadReadInput | Fires when the multipart/form-data decoder reads a non-file input field so its value can be captured. |
| OnMessage | Fires every time a client sends a text message and it is received by the server. |
| OnShutdown | Fires after the HTTP API server has stopped and no more requests are accepted. |
| OnStartup | Fires after the HTTP API server has started and is ready to accept connections. |
| OnTCPConnect | Fires after a client connects at TCP level and before the WebSocket handshake, so the connection can be accepted or rejected. |
| OnUnknownProtocol | Not currently supported by the HTTP API server; declared for API compatibility with TsgcWebSocketServer. |