Connect via Socket to

Make it possible to connect via socket. If socket is defined it will be
prefered