WebSocket server accepts WebSocket, HTTP, SSE... protocols, but can work too with plain tcp connections. Read more about TCP Connections.
There are 2 events, which can be used to handle TCP connections better.
OnTCPConnect
This event is called after a client connects to server and before any handshake between client and server. OnConnect event is only fired after client sends a message (to allow server detect which is the protocol to be used).
This event allows to know that a new client is trying to connect to server and server can accept or not the connection. By default, server always accept connection.
OnUnknownProtocol
This event is called when server receives a first message from client but cannot detect if is any of known protocols. In this event, server can accept or not protocol
OnConnect
This event is fired after a successful and complete connection, if connection is plain TCP, is fired after protocol is accepted in OnUnknownProtocol event.