Take the 2-minute tour ×

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_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,

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?


port 2195 is open

share|improve this question
Why are you connecting to proxy.net at port 9999? Is there a proxy there? Can you connect to port 9999 from your server? –  Marcus Adams Jul 3 '13 at 14:42
no ok the port is 8080, it's only a fake port for the snippet, however i change it –  Lucabro Jul 3 '13 at 14:46
A typical web proxy often runs on port 8080. You need a transparent proxy (gateway). –  Marcus Adams Jul 3 '13 at 16:25

Your Answer



Browse other questions tagged or ask your own question.