what way would be best to send a HTTP CONNECT request via php's stream_socket_client? or would it be irrelivant?
You'll have to delegate the request to a proxy of some sort. The proxy should then handle the request/response between the two communicating entities.