В моей локальной среде все работает нормально.
Я также перехожу по этой ссылке.
Вот серверный скрипт, который инициализирует сервер веб-сокетов и прослушивает клиентское соединение с портом 8080.< /p>
Код: Выделить всё
public function run()
{
$loop = Factory::create();
$pusher = new Pusher;
$context = new Context($loop);
$pull = $context->getSocket(ZMQ::SOCKET_PULL);
$pull->bind('tcp://127.0.0.1:5555'); // Binding to 127.0.0.1 means the only client that can connect is itself
$pull->on('message', array($pusher, 'onBlogEntry'));
// Set up our WebSocket server for clients wanting real-time updates
$webSock = new Server('0.0.0.0:8080', $loop); // Binding to 0.0.0.0 means remotes can connect
$webServer = new IoServer(
new HttpServer(
new WsServer(
new WampServer(
$pusher
)
)
),
$webSock
);
$loop->run();
Код: Выделить всё
var conn = new ab.Session('ws://localhost:8080',
function() {
/* subscribe to following topics */
conn.subscribe('new_order', function(topic, data) ..
Также отметим, что мое приложение размещено с использованием указанный порт из докер-контейнера.
Код: Выделить всё
http://192.168.12.52:8094/xyz/new/....
Код: Выделить всё
var conn = new ab.Session('ws://192.168.12.52:8080',
function() {
/* subscribe to following topics */
conn.subscribe('new_order', function(topic, data) ...
Код: Выделить всё
WebSocket connection to 'ws://192.168.11.32:8080/' failed: Error during WebSocket handshake: Unexpected response code: 403
Подробнее здесь: https://stackoverflow.com/questions/533 ... tion-estab