I don’t really know what this is doing (haven’t done any socket stuff in PHP myself), but if I’m reading this correctly (accepting an inbound connection?), requests into the apps aren’t using SSL by the time they reach the code. The fly-proxy “terminates” the SSL connection, sending non-ssl traffic to the application.
If that’s making an OUTGOING connection, then I think it should work - to my knowledge, no outbound traffic is blocked.
I don’t think Fly is blocking either the PHP function or the outbound network connection. It may be that the hostname cannot be resolved or the host is unreachable. What do $errno and $errstr contain?
["error","stream_socket_client returned FALSE : errno = 32708, errstr = Unable to find the socket transport \"ssl\" - did you forget to enable it when you configured PHP?"]
So your PHP is missing SSL support. Fixing this will depend on the OS/distro that the container image is based on, but usually installing the php-openssl package will do the trick.
Error You specified a process for '{"command"=>"php -S 0.0.0.0:$PORT -c /etc/php/conf.d/php.ini /app/public/index.php", "healthcheck"=>"curl -f http://localhost/ || exit 1", "type"=>"web"}' but it does not have a command defined. Double check the syntax for the [processes] section of your fly.toml https://fly.io/docs/reference/configuration/#the-processes-section