I\'m pretty sure this is a simple question, but I have no idea where the socket.io docs are and the one at http://labs.learnboost.com/socket.io/ don\'t really help.
Try calling:
socket.disconnect('unauthorized');
or
socket.close();
EDIT: You might be able to check the referer header. Look at Socket.io Security Issues for more info.