TsgcWebSocketProxyServer › Events
Events you can handle, grouped by purpose, followed by the full alphabetical list.
| Name | Description |
|---|---|
| OnStartup | Fires after the proxy server has started and is ready to accept connections. |
| OnShutdown | Fires after the proxy server has stopped and no more connections are accepted. |
| OnTCPConnect | Fires after a downstream 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 downstream client and the proxy opens the upstream TCP session. |
| OnDisconnect | Fires every time a WebSocket connection with a downstream client is dropped and the upstream TCP session is closed. |
| OnHandshake | Fires after the handshake with a downstream client is evaluated and before the response is sent. |
| OnError | Fires whenever a WebSocket protocol error occurs on a downstream client connection handled by the proxy. |
| OnException | Fires whenever an unhandled exception is raised while processing a downstream connection or its upstream forwarding. |
| OnUnknownProtocol | Fires when the first message from a downstream client does not match a known protocol so the connection can be accepted or rejected. |
| OnUnknownAuthentication | Fires when authentication is enabled and the authentication method of a downstream client is not recognized by the server. |
| Name | Description |
|---|---|
| OnMessage | Fires every time a downstream WebSocket client sends a text message, before the proxy forwards it upstream. |
| OnBinary | Fires every time a downstream WebSocket client sends a binary message, before the proxy forwards it upstream. |
| OnFragmented | Fires when a fragment of a message is received from a downstream client (only when Options.FragmentedMessages is frgAll or frgOnlyFragmented). |
| Name | Description |
|---|---|
| OnBeforeHeartBeat | Fires before each HeartBeat ping so the application can implement a custom keep-alive for a downstream WebSocket client. |
| OnLoadBalancerConnect | Fires when the proxy server connects to the Load Balancer Server. |
| OnLoadBalancerDisconnect | Fires when the proxy server disconnects from the Load Balancer Server. |
| OnLoadBalancerError | Fires when an error occurs communicating with the Load Balancer Server. |
| Name | Description |
|---|---|
| OnAuthentication | Fires when authentication is enabled so the application can check user and password and accept or reject the downstream client connection. |
| OnSSLGetHandler | Fires before the SSL handler is created so a custom server-side handler instance can be supplied. |
| OnSSLAfterCreateHandler | Fires after the SSL handler has been created so its properties can be customized. |
| OnSSLALPNSelect | Fires during an ALPN-enabled handshake with a downstream client so the application can pick which protocol to negotiate. |
| OnSSLVerifyPeer | Fires when VerifyCertificate is enabled and a downstream client presents a certificate to be accepted or rejected. |
| Name | Description |
|---|---|
| OnAuthentication | Fires when authentication is enabled so the application can check user and password and accept or reject the downstream client connection. |
| OnBeforeHeartBeat | Fires before each HeartBeat ping so the application can implement a custom keep-alive for a downstream WebSocket client. |
| OnBinary | Fires every time a downstream WebSocket client sends a binary message, before the proxy forwards it upstream. |
| OnConnect | Fires every time a WebSocket connection is established with a downstream client and the proxy opens the upstream TCP session. |
| OnDisconnect | Fires every time a WebSocket connection with a downstream client is dropped and the upstream TCP session is closed. |
| OnError | Fires whenever a WebSocket protocol error occurs on a downstream client connection handled by the proxy. |
| OnException | Fires whenever an unhandled exception is raised while processing a downstream connection or its upstream forwarding. |
| OnFragmented | Fires when a fragment of a message is received from a downstream client (only when Options.FragmentedMessages is frgAll or frgOnlyFragmented). |
| OnHandshake | Fires after the handshake with a downstream client is evaluated and before the response is sent. |
| OnLoadBalancerConnect | Fires when the proxy server connects to the Load Balancer Server. |
| OnLoadBalancerDisconnect | Fires when the proxy server disconnects from the Load Balancer Server. |
| OnLoadBalancerError | Fires when an error occurs communicating with the Load Balancer Server. |
| OnMessage | Fires every time a downstream WebSocket client sends a text message, before the proxy forwards it upstream. |
| OnShutdown | Fires after the proxy server has stopped and no more connections are accepted. |
| OnSSLAfterCreateHandler | Fires after the SSL handler has been created so its properties can be customized. |
| OnSSLALPNSelect | Fires during an ALPN-enabled handshake with a downstream client so the application can pick which protocol to negotiate. |
| OnSSLGetHandler | Fires before the SSL handler is created so a custom server-side handler instance can be supplied. |
| OnSSLVerifyPeer | Fires when VerifyCertificate is enabled and a downstream client presents a certificate to be accepted or rejected. |
| OnStartup | Fires after the proxy server has started and is ready to accept connections. |
| OnTCPConnect | Fires after a downstream client connects at TCP level and before the WebSocket handshake, so the connection can be accepted or rejected. |
| OnUnknownAuthentication | Fires when authentication is enabled and the authentication method of a downstream client is not recognized by the server. |
| OnUnknownProtocol | Fires when the first message from a downstream client does not match a known protocol so the connection can be accepted or rejected. |