Is it possible to terminate a websocket connection from server without closing the entire server? If it is then, how can I achieve it?
Note: I\'m using NodeJS as bac
If you use var client = net.createConnection() to create the socket you can use client.destroy() to destroy it.
var client = net.createConnection()
client.destroy()
With ws it should be:
ws
var server = new WebSocketServer(); server.on('connection', function (socket) { // Do something and then socket.close(); //quit this connection });