TsgcWebSocketProxyServer › Events

TsgcWebSocketProxyServer Events

Events you can handle, grouped by purpose, followed by the full alphabetical list.

Lifecycle

NameDescription
OnStartupFires after the proxy server has started and is ready to accept connections.
OnShutdownFires after the proxy server has stopped and no more connections are accepted.
OnTCPConnectFires after a downstream client connects at TCP level and before the WebSocket handshake, so the connection can be accepted or rejected.
OnConnectFires every time a WebSocket connection is established with a downstream client and the proxy opens the upstream TCP session.
OnDisconnectFires every time a WebSocket connection with a downstream client is dropped and the upstream TCP session is closed.
OnHandshakeFires after the handshake with a downstream client is evaluated and before the response is sent.
OnErrorFires whenever a WebSocket protocol error occurs on a downstream client connection handled by the proxy.
OnExceptionFires whenever an unhandled exception is raised while processing a downstream connection or its upstream forwarding.
OnUnknownProtocolFires when the first message from a downstream client does not match a known protocol so the connection can be accepted or rejected.
OnUnknownAuthenticationFires when authentication is enabled and the authentication method of a downstream client is not recognized by the server.

Data

NameDescription
OnMessageFires every time a downstream WebSocket client sends a text message, before the proxy forwards it upstream.
OnBinaryFires every time a downstream WebSocket client sends a binary message, before the proxy forwards it upstream.
OnFragmentedFires when a fragment of a message is received from a downstream client (only when Options.FragmentedMessages is frgAll or frgOnlyFragmented).

Reliability

NameDescription
OnBeforeHeartBeatFires before each HeartBeat ping so the application can implement a custom keep-alive for a downstream WebSocket client.
OnLoadBalancerConnectFires when the proxy server connects to the Load Balancer Server.
OnLoadBalancerDisconnectFires when the proxy server disconnects from the Load Balancer Server.
OnLoadBalancerErrorFires when an error occurs communicating with the Load Balancer Server.

Security

NameDescription
OnAuthenticationFires when authentication is enabled so the application can check user and password and accept or reject the downstream client connection.
OnSSLGetHandlerFires before the SSL handler is created so a custom server-side handler instance can be supplied.
OnSSLAfterCreateHandlerFires after the SSL handler has been created so its properties can be customized.
OnSSLALPNSelectFires during an ALPN-enabled handshake with a downstream client so the application can pick which protocol to negotiate.
OnSSLVerifyPeerFires when VerifyCertificate is enabled and a downstream client presents a certificate to be accepted or rejected.

All Events (alphabetical)

NameDescription
OnAuthenticationFires when authentication is enabled so the application can check user and password and accept or reject the downstream client connection.
OnBeforeHeartBeatFires before each HeartBeat ping so the application can implement a custom keep-alive for a downstream WebSocket client.
OnBinaryFires every time a downstream WebSocket client sends a binary message, before the proxy forwards it upstream.
OnConnectFires every time a WebSocket connection is established with a downstream client and the proxy opens the upstream TCP session.
OnDisconnectFires every time a WebSocket connection with a downstream client is dropped and the upstream TCP session is closed.
OnErrorFires whenever a WebSocket protocol error occurs on a downstream client connection handled by the proxy.
OnExceptionFires whenever an unhandled exception is raised while processing a downstream connection or its upstream forwarding.
OnFragmentedFires when a fragment of a message is received from a downstream client (only when Options.FragmentedMessages is frgAll or frgOnlyFragmented).
OnHandshakeFires after the handshake with a downstream client is evaluated and before the response is sent.
OnLoadBalancerConnectFires when the proxy server connects to the Load Balancer Server.
OnLoadBalancerDisconnectFires when the proxy server disconnects from the Load Balancer Server.
OnLoadBalancerErrorFires when an error occurs communicating with the Load Balancer Server.
OnMessageFires every time a downstream WebSocket client sends a text message, before the proxy forwards it upstream.
OnShutdownFires after the proxy server has stopped and no more connections are accepted.
OnSSLAfterCreateHandlerFires after the SSL handler has been created so its properties can be customized.
OnSSLALPNSelectFires during an ALPN-enabled handshake with a downstream client so the application can pick which protocol to negotiate.
OnSSLGetHandlerFires before the SSL handler is created so a custom server-side handler instance can be supplied.
OnSSLVerifyPeerFires when VerifyCertificate is enabled and a downstream client presents a certificate to be accepted or rejected.
OnStartupFires after the proxy server has started and is ready to accept connections.
OnTCPConnectFires after a downstream client connects at TCP level and before the WebSocket handshake, so the connection can be accepted or rejected.
OnUnknownAuthenticationFires when authentication is enabled and the authentication method of a downstream client is not recognized by the server.
OnUnknownProtocolFires when the first message from a downstream client does not match a known protocol so the connection can be accepted or rejected.