more modularized login. added test for socket.
websocket connection port is selectable for test