Implemented basic authentication for sockets