def request_x11(self, screen_number=<NUM_LIT:0>, auth_protocol=None, auth_cookie=None,<EOL>single_connection=False, handler=None):
if self.closed or self.eof_received or self.eof_sent or not self.active:<EOL><INDENT>raise SSHException('<STR_LIT>')<EOL><DEDENT>if auth_protocol is None:<EOL><INDENT>auth_protocol = '<STR_LIT>'<EOL><DEDENT>if auth_cookie is None:<EOL><INDENT>auth_cookie = binascii.hexlify(self.transport.rng.read(<NUM_LIT:16>))<EOL><DEDENT>m = Message()<EOL>m.add_byte(chr(MSG_CHANNEL_REQUEST))<EOL>m.add_int(self.remote_chanid)<EOL>m.add_string('<STR_LIT>')<EOL>m.add_boolean(True)<EOL>m.add_boolean(single_connection)<EOL>m.add_string(auth_protocol)<EOL>m.add_string(auth_cookie)<EOL>m.add_int(screen_number)<EOL>self._event_pending()<EOL>self.transport._send_user_message(m)<EOL>self._wait_for_event()<EOL>self.transport._set_x11_handler(handler)<EOL>return auth_cookie<EOL>
Request an x11 session on this channel.  If the server allows it,
further x11 requests can be made from the server to the client,
when an x11 application is run in a shell session.

From RFC4254::

    It is RECOMMENDED that the 'x11 authentication cookie' that is
    sent be a fake, random cookie, and that the cookie be checked and
    replaced by the real cookie when a connection request is received.

If you omit the auth_cookie, a new secure random 128-bit value will be
generated, used, and returned.  You will need to use this value to
verify incoming x11 requests and replace them with the actual local
x11 cookie (which requires some knoweldge of the x11 protocol).

If a handler is passed in, the handler is called from another thread
whenever a new x11 connection arrives.  The default handler queues up
incoming x11 connections, which may be retrieved using
L{Transport.accept}.  The handler's calling signature is::

    handler(channel: Channel, (address: str, port: int))

@param screen_number: the x11 screen number (0, 10, etc)
@type screen_number: int
@param auth_protocol: the name of the X11 authentication method used;
    if none is given, C{"MIT-MAGIC-COOKIE-1"} is used
@type auth_protocol: str
@param auth_cookie: hexadecimal string containing the x11 auth cookie;
    if none is given, a secure random 128-bit value is generated
@type auth_cookie: str
@param single_connection: if True, only a single x11 connection will be
    forwarded (by default, any number of x11 connections can arrive
    over this session)
@type single_connection: bool
@param handler: an optional handler to use for incoming X11 connections
@type handler: function
@return: the auth_cookie used