MCPcopy
hub / github.com/soketi/soketi / setUserAuthenticationTimeout

Method setUserAuthenticationTimeout

src/ws-handler.ts:821–837  ·  view source on GitHub ↗

* Set the authentication timeout for the socket.

(ws: WebSocket)

Source from the content-addressed store, hash-verified

819 * Set the authentication timeout for the socket.
820 */
821 protected setUserAuthenticationTimeout(ws: WebSocket): void {
822 ws.userAuthenticationTimeout = setTimeout(() => {
823 ws.sendJson({
824 event: 'pusher:error',
825 data: {
826 code: 4009,
827 message: 'Connection not authorized within timeout.',
828 },
829 });
830
831 try {
832 ws.end(4009);
833 } catch (e) {
834 //
835 }
836 }, this.server.options.userAuthenticationTimeout);
837 }
838}

Callers 1

onOpenMethod · 0.95

Calls 1

sendJsonMethod · 0.80

Tested by

no test coverage detected