linux上workerman启动成功了,但是客户端无法连接是怎么回事?

不知火舞

[attach]344[/attach]客户端用浏览器连接的,提示WebSocket connection to 'ws://xxxx:7272/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

6728 2 0
2个回答

walkor

可能是客户端连错IP了,或者连接被服务器iptables给挡了

  • 不知火舞 2016-07-15

    ip对的呢,按照网上的方法关闭了防火墙也不行

  • 不知火舞 2016-07-15

    $gateway = new Gateway("Websocket://0.0.0.0:7272");这个要不要设置成服务器的真实ip?

  • 不知火舞 2016-07-15

    对了,我运行的时候提示 workerman/work.php1385行有错误
    我把这段代码改成这个了
    $this->_mainSocket = stream_socket_server($local_socket, $errno, $errmsg, $flags, $this->_context);
    if (!$this->_mainSocket) {
    // throw new Exception($errmsg);
    echo $errmsg;
    }
    和这个有关吗?

  • 不知火舞 2016-07-15

    那个错误是Fatal error: Uncaught exception 'Exception' in /

不知火舞

[attach]345[/attach]
防火墙关闭了吧

  • 暂无评论
年代过于久远,无法发表回答
🔝