0
내 웹 소켓 파일 :래칫 PHP 웹 소켓 지속적 우분투 16.04
<?php
require __DIR__ . '/../../../vendor/autoload.php';
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;
require 'chat.php';
// Run the server application through the WebSocket protocol on port 8080
$app = new Ratchet\App("localhost", 8080, '0.0.0.0', $loop);
$app->route('/chat', new Chat, array('*'));
$app->run();
나는 셋업 내 웹 소켓이 설명서 다음 : 그것은 php socket.php
를 사용하여 작동 로컬 https://blog.samuel.ninja/the-tutorial-for-php-websockets-that-i-wish-had-existed/
을 (창 10에 XAMPP 테스트) .
WebSocket connection to 'ws://localhost:8080/chat?id=NDY=&group=43,60' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
PS : 내 가상 컴퓨터에 배포 할 때 는 (16.04를 우분투)이 오류가 나는 또한 대신에 서비스를 시작해야 php /var/www/path-to-websocket/socket.php
사용하여 웹 소켓을 시작하려고했다 명령 줄은 있지만 설명 된 방법이 작동하지 않습니다.