테스트 사이트 - 개발 중인 베타 버전입니다

방화벽에 막혀있는듯 한데 확인방법은? 채택완료

훈련소장 7년 전 조회 3,394

</p>

<p><?php

include_once(dirname(__FILE__) . "/../common.php");

include_once(dirname(__FILE__) . "/Snoopy/Snoopy.class.php");

include_once(dirname(__FILE__) . '/http.php');</p>

<p>$page = array(1,2);

$gamer = array();

for($page = 1; $page <= 3; $page++) {

    $snoopy = new Snoopy;

    $snoopy->fetch("<a href="http://live.afreecatv.com:8057/api/main_broad_list_api.php?callback=jQuery110205749143180542042_1497043598834");" target="_blank" rel="noopener noreferrer">http://live.afreecatv.com:8057/api/main_broad_list_api.php?callback=jQuery110205749143180542042_1497043598834");</a>

    $result = $snoopy->results;</p>

<p>    $result = substr($result, strpos($result, "(") + 1);

    $result = substr($result,0,-2);

    $result = str_replace("'", "'", $result);

    $json_arr = json_decode($result, true);

    foreach($json_arr['broad'] as $json_key => $json_val){

...</p>

<p>

 

서버를 이전하니까 이게 실행이 안됩니다. 

http://live.afreecatv.com:8057 이부분에서 8057은 상대방 포트이므로 이쪽 방화벽하고는 관계가

없을듯한데 맞나요?

 

</p>

<p> function _connect(&$fp)

    {

        if (!empty($this->proxy_host) && !empty($this->proxy_port)) {

            $this->_isproxy = true;</p>

<p>            $host = $this->proxy_host;

            $port = $this->proxy_port;</p>

<p>            if ($this->scheme == 'https') {

                trigger_error("HTTPS connections over proxy are currently not supported", E_USER_ERROR);

                exit;

            }

        } else {

            $host = $this->host;

            $port = $this->port;

        }</p>

<p>        $this->status = 0;</p>

<p>        $context_opts = array();</p>

<p>        if ($this->scheme == 'https') {

            // if cafile or capath is specified, enable certificate

            // verification (including name checks)

            if (isset($this->cafile) || isset($this->capath)) {

                $context_opts['ssl'] = array(

                    'verify_peer' => true,

                    'CN_match' => $this->host,

                    'disable_compression' => true,

                );</p>

<p>                if (isset($this->cafile))

                    $context_opts['ssl']['cafile'] = $this->cafile;

                if (isset($this->capath))

                    $context_opts['ssl']['capath'] = $this->capath;

            }

                    

            $host = 'ssl://' . $host;

        }</p>

<p>        $context = stream_context_create($context_opts);</p>

<p>        if (version_compare(PHP_VERSION, '5.0.0', '>')) {

            if($this->scheme == 'http')

                $host = "tcp://" . $host;

            $fp = stream_socket_client(

                "$host:$port",

                $errno,

                $errmsg,

                $this->_fp_timeout,

                STREAM_CLIENT_CONNECT,

                $context);</p>

<p> </p>

<p>

 

snoopy라는 오픈소스 코드인데 외부 fetch 하는 것인데 어떤 포트가 막혀있는지 모르겠네요.

 

아프리카 현재 방송중인 리스트를 가져오는 소스일부인데, 나갈때, 어떤포트를 들어올때 어떤 포트를

 

사용하는 걸까요... 방화벽을 풀어야하는데 포트확인을 못하겠습니다.

댓글을 작성하려면 로그인이 필요합니다.

답변 2개

훈련소장

방화벽을 아예 해제하여 해결하였습니다..

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

복스리
7년 전

telnet aaa.co.kr 444(포트번호)

 

서버나 개인 피시에서 이런식으로  telnet을 사용하여 command를 날려보셨을떄 반응하면 열려 있는거구요.반응이 안되면 닫혀 있다고 보시면 정확합니다.

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

훈련소장
7년 전
어떤 포트를 확인해야하는 지 몰라서요...http://live.afreecatv.com:8057 를 보내는데, 이쪽에 8057포트가 열려야하는건 아니죠?
복스리
7년 전
8057 포트가 맞습니다~

telnet live.afreecatv.com 8057
이렇게 해보셔서 반응이 있는지 시도해보시기 바랍니다.

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인