How to configure apache with socket transport "wss"

Viewed 138

I try to connect from php to server by using websockets. This is my code

$opts = [
    'ssl' => [
        'cafile' => 'core/certs/root.pem',
        'local_cert' => 'core/certs/client.pem',
        'local_pk' => 'core/certs/client_key.pem'
    ]
];
$content = stream_context_create($opts, $opts);

$socket = stream_socket_server(
    "wss://$host",
    $errno,
    $errstr,
    STREAM_SERVER_BIND|STREAM_SERVER_LISTEN,
    $content
);

After running script I got error:

Unable to find the socket transport "wss" - did you forget to enable it when you configured PHP? (0)

How to enable socket transport "wss" in apache?

0 Answers
Related