allinurl/gwsocket

API to disconnect client in strict mode

yarreg opened this issue · 3 comments

  • In the event that a client fails to pass the authorization process, it becomes necessary to disconnect them from the WebSocket connection promptly;
  • Load balancing...

I'm not sure what you're asking. Could you please clarify your question or provide more information about the issue you're experiencing?

I need an API (e.g in gwsocket strict mode) to disconnect an already connected client.
For example, it is need to disconnect a user who has not passed the authentication process.

Invoking ws_close(listener) should address your issue. Alternatively, you could use ws_handle_close(client), which may be a better approach. However, both ways will require changing the function's scope, as they're currently set to static