public static function tor($proxy = '127.0.0.1:9050', $torControl = '127.0.0.1:9051')
    {
        return function (callable $handler) use ($proxy, $torControl) {
            return function (
                RequestInterface $request,
                array $options
            ) use ($handler, $proxy, $torControl) {
                $options = array_replace_recursive([
                    'proxy' => $proxy,
                    'curl'  => [
                        CURLOPT_PROXYTYPE => CURLPROXY_SOCKS5_HOSTNAME
                    ]
                ], $options);

                if (array_key_exists('tor_new_identity', $options) && $options['tor_new_identity']) {
                    try {
                        self::requireNewTorIdentity($torControl, $options);
                    } catch (GuzzleException $e) {
                        if (@$options['tor_new_identity_exception']) {
                            throw $e;
                        }
                    }
                }

                return $handler($request, $options);
            };
        };
    }