gwsocket icon indicating copy to clipboard operation
gwsocket copied to clipboard

API to disconnect client in strict mode

Open yarreg opened this issue 2 years ago • 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...

yarreg avatar Jun 01 '23 23:06 yarreg

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

allinurl avatar Jun 04 '23 17:06 allinurl

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.

yarreg avatar Jun 04 '23 20:06 yarreg

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

allinurl avatar Jun 08 '23 17:06 allinurl