I have an Apache-2.4 web server. It will execute PHP scripts if a client requests https://my.domain.com/script-name.php
, and the output of the script shows up in the browser window. (Or it can be retrieved as AJAX data by Javascript.)
I would like to have a PHP script started this way, but have it talk to Javascript code in the browser which has done:
ws = new WebSocket( 'https://my.domain.com/script-name.php' );
Is this something that can be managed from within the PHP script, or must I use something like mod_proxy_wstunnel
?
(I believe the underlying question is, what communication channels are available to a PHP script started by Apache? Does it have stdin/stdout as SSL sockets to/from the browser? Or is it receiving buffered data from Apache, and writing output data back to a buffer that Apache will eventually send to the client?)