i've read different question similar to mine, but no answer works for me:
$deviceToken = 'token';
$passphrase = 'passphrase';
$message = 'Questa è una notifica!';
////////////////////////////////////////////////////////////////////////////////
$ctx = stream_context_create();
$options = array('http' => array('proxy' => 'tcp://proxy.net:8080', 'request_fulluri' => true));
stream_context_create($options);
stream_context_set_option($ctx, 'ssl', 'local_cert', 'cert.pem');
stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);
// Open a connection to the APNS server
$fp = stream_socket_client(
'ssl://gateway.sandbox.push.apple.com:2195', $err,
$errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
the error is
Failed to connect: 110 Connection timed out
i've tried to change $option value with:
$options = array('ssl' => array('proxy' => 'tcp://proxy.net:8080', 'request_fulluri' => true));
but nothing work, the proxy is absolutly minimal and direct connection are not possible.
Any suggestion about something to ask to IT division?
UPDATE
port 2195 is open
If your proxy support CONNECT method you need to connect first to the proxy then ask the proxy to connect you to apns server and finally switch up SSL.
You can after this use the stream as normal.
Have a look at this code here: Fork of SimplePush.php