connect and adapt to the real server