RFC apache2handler - Added the apache_connection_stream() function for CGI WebSockets
| From: | Richard Miles | Date: | Fri, 26 Apr 2024 04:39:15 +0000 |
| Subject: | RFC apache2handler - Added the apache_connection_stream() function for CGI WebSockets | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-123213@lists.php.net to get a copy of this message | ||
Howdy everyone,
I’m reaching out in an attempt to start an RFC for the apach2handler module, and I'm eager to
hear your perspectives. I’ve already created a Draft PR on GitHub
(https://github.com/php/php-src/pull/14047), and I am ready to move forward with the next steps of
the proposal (RFC karma/wiki). The current Apache2handler issue is the inability to get user input
during an HTTP 101 Upgrade request. Current PHP standards require binding to a port and serving all
connections in a PHP CLI server. In my brief draft, I explain how current io streams function and
how this solution differs. My change could be a game-changer for shared hosting environments. But
what's even more exciting is its unexplored potential for normal requests. This could open up a
whole new world of possibilities. I'm open to further discussion and collaboration to ensure
its success and get passing tests :)
The function would expose the HTTPD function
ap_get_conn_socket; below are the
generalized calls.
apr_sock = ap_get_conn_socket(r->connection);
stream = php_stream_sock_open_from_socket(fd, NULL);
apr_os_sock_get(&fd, apr_sock)
php_stream_to_zval(stream, return_value);
Please refer to the PR for the real implementation :) Thanks for your time!
PHP Wiki user: WookieeTyler
Best,
Richard Miles
Miles Systems LLC
Richard@Miles.Systems
(817) 789-3294

Confidentiality Notice: This email message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential and privileged information. Any unauthorized
review, use, disclosure, or distribution is prohibited. If you are not the intended recipient,
please contact the sender by reply email and destroy all copies of the original message.