update client1.js

move client connect and close function inside the client module