Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/255.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Debian上运行的Ratchet PHP Websocket_Php_Ssl_Websocket_Debian_Phpwebsocket - Fatal编程技术网

在Debian上运行的Ratchet PHP Websocket

在Debian上运行的Ratchet PHP Websocket,php,ssl,websocket,debian,phpwebsocket,Php,Ssl,Websocket,Debian,Phpwebsocket,我正在Debian上运行以下Ratchet脚本 <?php use Workerman\Worker; require_once '/var/www/app/vendor/autoload.php'; // SSL context. $context = array( 'ssl' => array( 'local_cert' => '/var/www/app/certs/cert.pem', 'local_pk' =>

我正在Debian上运行以下Ratchet脚本

<?php

use Workerman\Worker;

require_once  '/var/www/app/vendor/autoload.php';

// SSL context.
$context = array(
    'ssl' => array(
        'local_cert'  => '/var/www/app/certs/cert.pem',
        'local_pk'    => '/var/www/app/certs/key.pem',
        'verify_peer' => false,
    )
);

// Create a Websocket server with ssl context.
$ws_worker = new Worker('websocket://my.server.ip.address:2346', $context);

// Enable SSL. WebSocket+SSL means that Secure WebSocket (wss://). 
// The similar approaches for Https etc.
$ws_worker->transport = 'ssl';

$ws_worker->onMessage = function ($connection, $data) {
    // Send hello $data
    $connection->send('Hello ' . $data);
};

Worker::runAll();
我明白了

----------------------------------------------- WORKERMAN -----------------------------------------------
Workerman version:4.0.15          PHP version:7.3.23
------------------------------------------------ WORKERS ------------------------------------------------
proto   user            worker          listen                             processes    status      
ssl     root            none            websocket://my.server.ip:2346    1             [OK]       
----------------------------------------------------------------------------------------------------
但是当我访问websocket://my.server.ip.address:2346“在我的浏览器中,我得到

Your search - websocket://66.175.215.122:2346 - did not match any documents.

Suggestions:

Make sure that all words are spelled correctly.
Try different keywords.
Try more general keywords.

知道我哪里出错了吗?

websocket是从我的Android客户端运行的。它只是在尝试直接从浏览器访问时出错

Your search - websocket://66.175.215.122:2346 - did not match any documents.

Suggestions:

Make sure that all words are spelled correctly.
Try different keywords.
Try more general keywords.