def acquire_proxy(self, host, port, use_ssl=False, host_key=None,
                      tunnel=True):
        '''Check out a connection.

        This function is the same as acquire but with extra arguments
        concerning proxies.

        Coroutine.
        '''
        if self._host_filter and not self._host_filter.test(host):
            connection = yield from \
                super().acquire(host, port, use_ssl, host_key)

            return connection

        host_key = host_key or (host, port, use_ssl)
        proxy_host, proxy_port = self._proxy_address

        connection = yield from super().acquire(
            proxy_host, proxy_port, self._proxy_ssl, host_key=host_key
        )
        connection.proxied = True

        _logger.debug('Request for proxy connection.')

        if connection.closed():
            _logger.debug('Connecting to proxy.')
            yield from connection.connect()

            if tunnel:
                yield from self._establish_tunnel(connection, (host, port))

            if use_ssl:
                ssl_connection = yield from connection.start_tls(self._ssl_context)
                ssl_connection.proxied = True
                ssl_connection.tunneled = True

                self._connection_map[ssl_connection] = connection
                connection.wrapped_connection = ssl_connection

                return ssl_connection

        if connection.wrapped_connection:
            ssl_connection = connection.wrapped_connection
            self._connection_map[ssl_connection] = connection
            return ssl_connection
        else:
            return connection
Check out a connection.

        This function is the same as acquire but with extra arguments
        concerning proxies.

        Coroutine.