def eventsource_connect(url, io_loop=None, callback=None, connect_timeout=None):
if io_loop is None:<EOL><INDENT>io_loop = IOLoop.current()<EOL><DEDENT>if isinstance(url, httpclient.HTTPRequest):<EOL><INDENT>assert connect_timeout is None<EOL>request = url<EOL>request.headers = httputil.HTTPHeaders(request.headers)<EOL><DEDENT>else:<EOL><INDENT>request = httpclient.HTTPRequest(<EOL>url,<EOL>connect_timeout=connect_timeout,<EOL>headers=httputil.HTTPHeaders({<EOL>"<STR_LIT>": "<STR_LIT>"<EOL>})<EOL>)<EOL><DEDENT>request = httpclient._RequestProxy(<EOL>request, httpclient.HTTPRequest._DEFAULTS)<EOL>conn = EventSourceClient(io_loop, request)<EOL>if callback is not None:<EOL><INDENT>io_loop.add_future(conn.connect_future, callback)<EOL><DEDENT>return conn.connect_future<EOL>
Client-side eventsource support.

    Takes a url and returns a Future whose result is a
    `EventSourceClient`.