질문/조언질답게시판
Extra Form
PHP PHP 7.2
CMS Rhymix

웹소켓 통신하려고 하는데 작동이 안됩니다.

 

다음은 웹소켓 통신에 쓰여지는 소스입니다.

 

var socket = io.connect('https://www.ilbesecond.net:3000', {secure: true});

$.notify.addStyle('ilboard', {
    html: "<div><span data-notify-text/><div class='closeBtn'></div></div>",
    classes: {
        base: {
            "white-space": "nowrap",
            "min-width": "300px",
            "border": "3px solid #ddd",
            "-moz-border-radius": "7px",
            "-webkit-border-radius": "7px",
            "background-color": "#fff",
            "padding": "10px",
            "padding-left": "40px"
        },
        success: {
            "background": "#f9fdff url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAACTFBMVEUAAAAGTZcGTpgLVp4NY5YPdqYFTJcLWKINV40QdqkAQ5YARpICSpoDTZ4KU4gMZZgObaAPeakASY8La5wAQH8ATZkIR4EOeagAQYQASZILV40NcaEAOHIARIkAR44ASZEASpMCQ3wFYKUFYKYKSIAKTocMaKYNZZkOcqMOd6YPap8Pfq4Qfa4RXp4RX6AReqoRgLEVjrsWaKMWiLYXaaMXbakXjbsXjr0Xj74XmMMXmcQYb6wYkMEYksMYk8QYlsMZkb8ZksEZlMYZlcQZlsUZlsgZlskZl8YZmMsZm8calscams0aosoapMsbmskbm8kcntMcn8sdl8kdm8wdnssdodQdodYen80erdMfns4foM8fpdEgodAgo9EgpNMgqNIiotYkpNclpNcpptgrptgsp9gxuNQyqdk9pLxBsNxGrLxJs91LtN5Otd5Qtt9SrsJTrcdTt99Ut99UwM5WuN9WxeBXssxXud9YueBYvt9ZueBbuuBcu+BevOFfveFhzNNiveJlvuJmvuJoweNp4+hs4ehtwuNtyeNt3d1t5Ohx5+xyxOV16Ot31d934ep4xuZ65OR9yOd/2uN/5+SA5NyD5+GGzOmH5uCJ5+mL6umM4emNz+qPz+qR0uuR0+qS1+mS7uWU0+uU2OmW4+SW5OSX3ueb4eic1u2e1+2f1+2g4uqi7emj2e6m2u6o6Ou24PHA5fPF5/TG5/TK6fXM6vXV7vjc8Pnf8fnp9fvu+Pzv+fzx+v3z+v30+/33+/35/f76/f78/f7+//////8OgUZBAAAAHHRSTlMALCwsLCw9PT09lZWVlZWVlZWrq97e3t79/f39hpzhFAAAAb5JREFUGBkFwclqU1EAgOH/DHdMMw/VouKqhVp0X+sjuBDXFcG3Kz6DLoRsCgaSoi0JIVATk2uboWlyx9zj9wkAwLY8V5JHYZoAgABAtppv91sFNsGsHcwMgADw6++PKyIxCNusBxf3W0AAtZef6ib94UnYvLPE+OtwDgr2Dj83d8n6/sObk6PfJSVrJ5NFgkbVv9Qe/s6EyRW2GZr9p9XzP+FO8eTjq/F1bEiPpYl/aTucWgfe6FE6xbObgVaOk4/m84ddpaH04Oas6Cj/3B8Wc0frOPv5vVv1Up3781Klq91n/TLeLRSrr0X+bczkFL//3NWFSEOvAo+HrqHnK9E+tURYkErmumcPhoOu8QvaTqJMtlVuSSljpzOdkGMBgEmTZdvKpMy80R0AAAYwmdj2vZ3eXPeVBgBAJ5DDbXkjo8uGAMBIgwDAonYZySQu+AAgDQoAnL04kdFy5QsADAAApdUykgRDvyYAAABE3R8GSLLpVaUqgGy9WoIQ1crVNENBnK1fuFm+6+zuLjBOw+9MFqCAMFk3yk7qbQJv2yin3ckCEABYrWb5QBtENln9C1IAAQB4rl2T5PMkCgHgP6rNx2tWStwCAAAAAElFTkSuQmCC') no-repeat",
            "background-size": "24px",
            "background-position": "8px 6px"
        },
        error: {
            "background": "#fffaf9 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAEEElEQVR42s2Va2wUVRTH/3dmOn1tt8u23b63BW0MQmIgQVJEVOSRSHdJSkRitFb5QqLxizF8UuojxugXY2JQE8MXXx+A2lbUNhIxKG0CJK3YYEu3S9dut/vqe7vdeV3PTMmSZcVW1MRJbu7dc885v7nnP/csw3/8sP8VYKip+agOXnvv1+0v/OuAod1eXrRxLTgTEPvVh/t6OlcVuyqna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PICg3ATIV4XJ8xizR8lcUXlMzRjnccNlg0LU36O11xojDodMGpbB+m4fRuW7NKtkNgms39jVaW/4wEF1SyG4EDi/O1v0BdaNJ3oB8YjwAAAAASUVORK5CYII=') no-repeat",
            "background-size": "24px",
            "background-position": "8px 6px"
        }
    }
});
$(document).on('click', '.notifyjs-ilboard-base .closeBtn,.notifyjs-ilboard-notify-base .closeBtn', function() {
  $(this).trigger('notify-hide');
});

socket.on("sendToClient", function(data) {
    $.notify.addStyle('ilboard-notify', {
        html: "<div><a href='"+data.url+"' class='link'><span data-notify-text/>"+data.title+"</a><div class='closeBtn'></div></div>",
        classes: {
            base: {
                "white-space": "nowrap",
                "min-width": "300px",
                "border": "3px solid #ddd",
                "-moz-border-radius": "7px",
                "-webkit-border-radius": "7px",
                "background-color": "#fff",
                "padding": "10px",
                "padding-left": "40px"
            },
        }
    })
    $.notify("[New 일베] ",{
        globalPosition: 'bottom right',
        style: 'ilboard-notify',
        clickToHide: false,
        autoHideDelay: 6000
    });
});

function getCookie(cname) {
  var name = cname + "=";
  var decodedCookie = decodeURIComponent(document.cookie);
  var ca = decodedCookie.split(';');
  for(var i = 0; i <ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0) == ' ') {
      c = c.substring(1);
    }
    if (c.indexOf(name) == 0) {
      return c.substring(name.length, c.length);
    }
  }
  return "";
}

/*
function connStatus(type) {
    var v = '전체 : <strong class="allConn">'+allConn+'</strong>명<br />PC : <strong class="pcConn">'+pcConn+'</strong>명<br />모바일 : <strong class="mobileConn">'+mobileConn+'</strong>명';
    var m = '접속자 : <strong>'+allConn+'</strong>명';
    if($('#currConn')) {
        switch(type) {
            case 0:
                $('#currConn').html(v);
            case 1:
                $('#currConn .pcConn').html(pcConn);
                break;
            case 2:
                $('#currConn .mobileConn').html(mobileConn);
                break;
        }
        
        $('#currConn .allConn').html(allConn);
    }if($('#currConnMobile')) {
        $('#currConnMobile').html(m);
        $('#currConnMobile strong').html(allConn);
    }
}

var allConn = 0;
var pcConn = 0;
var mobileConn = 0;

socket.emit('ibdConn', {
    session_id: getCookie('ilboard_key'),
    is_mobile : ILBOARD_AC_IS_MOBILE
});

socket.emit('chkConn');

socket.on("ibdConn", function(data) {
    var d = JXG.decompress(data);
    var j = JSON.parse(d);
    
    if(j.allConn) {
        allConn = j.allConn;
        pcConn = j.pcConn;
        mobileConn = j.mobileConn;
        connStatus(0);
    }
    
    if(j.type && allConn > 0) {
        var g = j.ibdConn;
        if(j.type == 'pc') {
            pcConn += g;
            allConn += g;
            connStatus(1);
        } else if(j.type == 'mobile') {
            mobileConn += g;
            allConn += g;
            connStatus(2);
        }
    }
});
*/

 

 

실시간 인기글을 체크하거나 댓글이 달렸을때를 체크해서 알림을 쏴주는 방식인데요

우분투에 websocket.io 설치 해줬음에도 안되네요.

netstat -an | grep LISTEN 해봐도 어디 위치에 실행되는지 전혀 알 수가 없구요.

포트 변경하는 방법 없을까요

websocket.io 설정파일 경로 좀 알려주세요