How to connect to a remote server and execute eg a search