stream_socket_client über http-proxy
Arbeite ich an APNS (Apple Push Notification Service).
Ich mache es wie tutorials sagte:
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck.pem');
stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);
$fp = stream_socket_client(
'ssl://gateway.sandbox.push.apple.com:2195', $err,
$errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
Aber auf meinem server habe ich die Verbindung zum internet über einen HTTP-proxy, so bekam ich immer timeout-Fehler mit diesen code. Wie kann ich einstellen, dass http-proxy für strem_socket_client mit ssl-Protokoll?
Du musst angemeldet sein, um einen Kommentar abzugeben.
Beste Weg ist, um
proxy
Optionen mitstream_context_create
:Sehen http://php.net/manual/en/context.http.php für die vollständige http-Optionen.
Vielleicht kann man dann
request_fulluri
zu wahren.