douyou7797 2016-06-20 06:47
浏览 43

无法打开套接字 - ReCAPTCHA

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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
    • ¥20 关于URL获取的参数,无法执行二选一查询
    • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
    • ¥15 marlin编译错误,如何解决?
    • ¥15 有偿四位数,节约算法和扫描算法
    • ¥15 VUE项目怎么运行,系统打不开
    • ¥50 pointpillars等目标检测算法怎么融合注意力机制
    • ¥20 Vs code Mac系统 PHP Debug调试环境配置
    • ¥60 大一项目课,微信小程序
    • ¥15 求视频摘要youtube和ovp数据集