Reputation: 31
How can I close a websocket connection manually (from server side) in Cowboy-server? I would check login/password in callback-module in init/3 and kick "wrong" users with some return code. What is the best way to do this?
Upvotes: 3
Views: 1110
Reputation: 1830
Try to return {shutdown, Req, State} from your handler:
https://github.com/extend/cowboy/blob/master/src/cowboy_websocket_handler.erl
Upvotes: 1