Overview: I got DDOSed recently and implemented a firewall with rules as an additional countermeasure for preventing this sort of thing from happening again. I portforwarded and everything seems to work fine now: here's my website -> http://dynastyms.net
Problem: The reCAPTCHA seems to have stopped working. It says the socket has failed. When I try to register, it tells me that the socket was not open. This sort of issue did not occur when I did not have my firewall up.
Here is the code and the line that is printed when the socket connection fails.
function _recaptcha_http_post($host, $path, $data, $port = 80) {
$req = _recaptcha_qsencode ($data);
$http_request = "POST $path HTTP/1.0
";
$http_request .= "Host: $host
";
$http_request .= "Content-Type: application/x-www-form-urlencoded;
";
$http_request .= "Content-Length: " . strlen($req) . "
";
$http_request .= "User-Agent: reCAPTCHA/PHP
";
$http_request .= "
";
$http_request .= $req;
$response = '';
if( false == ( $fs = @fsockopen($host, 8080, $errno, $errstr, 10) ) ) {
die ('Could not open socket');
}
fwrite($fs, $http_request);
while ( !feof($fs) )
$response .= fgets($fs, 1160); // One TCP-IP packet
fclose($fs);
$response = explode("
", $response, 2);
return $response;
}
I get the "could not open socket" error. Not sure what to do here. My port 8080 is open as well.