def server(url, **kwargs):
from vaex.remote import ServerRest<EOL>url = urlparse(url)<EOL>if url.scheme == "<STR_LIT>":<EOL><INDENT>websocket = True<EOL><DEDENT>else:<EOL><INDENT>websocket = False<EOL><DEDENT>assert url.scheme in ["<STR_LIT>", "<STR_LIT:http>"]<EOL>port = url.port<EOL>base_path = url.path<EOL>hostname = url.hostname<EOL>return vaex.remote.ServerRest(hostname, base_path=base_path, port=port, websocket=websocket, **kwargs)<EOL>
Connect to hostname supporting the vaex web api.

    :param str hostname: hostname or ip address of server
    :return vaex.dataframe.ServerRest: returns a server object, note that it does not connect to the server yet, so this will always succeed
    :rtype: ServerRest