방화벽에 막혀있는듯 한데 확인방법은?
본문
<?php
include_once(dirname(__FILE__) . "/../common.php");
include_once(dirname(__FILE__) . "/Snoopy/Snoopy.class.php");
include_once(dirname(__FILE__) . '/http.php');
$page = array(1,2);
$gamer = array();
for($page = 1; $page <= 3; $page++) {
$snoopy = new Snoopy;
$snoopy->fetch("http://live.afreecatv.com:8057/api/main_broad_list_api.php?callback=jQuery110205749143180542042_1497043598834");
$result = $snoopy->results;
$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){
...
서버를 이전하니까 이게 실행이 안됩니다.
http://live.afreecatv.com:8057 이부분에서 8057은 상대방 포트이므로 이쪽 방화벽하고는 관계가
없을듯한데 맞나요?
function _connect(&$fp)
{
if (!empty($this->proxy_host) && !empty($this->proxy_port)) {
$this->_isproxy = true;
$host = $this->proxy_host;
$port = $this->proxy_port;
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;
}
$this->status = 0;
$context_opts = array();
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,
);
if (isset($this->cafile))
$context_opts['ssl']['cafile'] = $this->cafile;
if (isset($this->capath))
$context_opts['ssl']['capath'] = $this->capath;
}
$host = 'ssl://' . $host;
}
$context = stream_context_create($context_opts);
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);
snoopy라는 오픈소스 코드인데 외부 fetch 하는 것인데 어떤 포트가 막혀있는지 모르겠네요.
아프리카 현재 방송중인 리스트를 가져오는 소스일부인데, 나갈때, 어떤포트를 들어올때 어떤 포트를
사용하는 걸까요... 방화벽을 풀어야하는데 포트확인을 못하겠습니다.
!-->!-->답변 2
telnet aaa.co.kr 444(포트번호)
서버나 개인 피시에서 이런식으로 telnet을 사용하여 command를 날려보셨을떄 반응하면 열려 있는거구요.반응이 안되면 닫혀 있다고 보시면 정확합니다.
방화벽을 아예 해제하여 해결하였습니다..
답변을 작성하시기 전에 로그인 해주세요.