reCAPTCHA
reCAPTCHA copied to clipboard
Configurable proxy
Hi, is it possible to make a configurable proxy? Our company policy will not allow that file_get_contents request. Specifically, the file is ReCaptchaProvider.php, function makeRequest (), line 102.
Now I have to make a hard adjustment to:
$aContext = array(
'http' => array(
'proxy '=> 'proxyXYZ.de:8000',
'request_fulluri' => true,
),
);
$context = stream_context_create($aContext);
return @file_get_contents($this->buildUrl($params), false, $context);
Otherwise, the recaptcha always returns to me that I am a robot
Hey @MVnComputers. Sure, could you please more elaborate a propose some http client changes? Thanks man.
Hi guys, I have same situation as MVnComputers. My servers are behind proxy server so I had to hardcode stream_context_create as example above in file ReCaptchaProvider.php, function makeRequest (), line 102.
/**
* @param mixed $response
* @return mixed
*/
protected function makeRequest($response, ?string $remoteIp = null)
{
if (empty($response)) {
return null;
}
$params = [
'secret' => $this->secretKey,
'response' => $response,
];
if ($remoteIp !== null) {
$params['remoteip'] = $remoteIp;
}
return @file_get_contents($this->buildUrl($params), false, stream_context_create(array(
'http' => array(
'proxy' => '192.168.41.240:3128',
'request_fulluri' => true,
),
)));
}
Is it possible to integrate optional arguments to neon configuration file like?
recaptcha:
secretKey: xxx
siteKey: xxx
proxy:
host: xxx
port: 3128
Thanks