added a local copy of socket script