【发布时间】:2013-07-03 14:18:03
【问题描述】:
我读过与我类似的不同问题,但没有适合我的答案:
$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);
错误是
Failed to connect: 110 Connection timed out
我尝试使用以下方法更改 $option 值:
$options = array('ssl' => array('proxy' => 'tcp://proxy.net:8080', 'request_fulluri' => true));
但是没有任何作用,代理绝对是最小的,直接连接是不可能的。
对 IT 部门有什么建议吗?
更新
2195 端口已打开
【问题讨论】:
-
为什么要在 9999 端口连接到 proxy.net?那里有代理吗?你能从你的服务器连接到端口 9999 吗?
-
不,端口是 8080,它只是 sn-p 的假端口,但是我改变了它
-
一个典型的网络代理通常运行在 8080 端口。你需要一个透明代理(网关)。
标签: php ios proxy apple-push-notifications