Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9081975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:26:45+00:00 2026-06-16T20:26:45+00:00

I have to confirm that my PHP code for sending push notification is working

  • 0

I have to confirm that my PHP code for sending push notification is working with a proxy. I installed Charles and I’m able to watch all my web traffic through a proxy (127.0.0.1:8888).

Now I would like to see if my script is correctly working for push notifications.
I have :

stream_context_set_option($ctx, 'http', 'proxy', 'tcp://127.0.0.1:8888');
$fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err,$errstr, 60, STREAM_CLIENT_CONNECT, $ctx);

I’m getting my push notification but I can’t see what is happening in Charles. So my script is not using proxy …

Do you know why ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T20:26:46+00:00Added an answer on June 16, 2026 at 8:26 pm

    This is because you passed a context with http options to stream_socket_client() – and more to the point you used an ssl:// wrapper instead of http:// or https://.

    The stream_socket_*() functions do not know that you are implementing HTTP so they do not use the http context options – in order for this to work you would need to do e.g.

    $fp = fopen('https://gateway.sandbox.push.apple.com:2195/path/to/file', 'r', false, $ctx);
    

    This is probably a better idea anyway, because it is unlikely you would need the granular control that implementing HTTP manually would give you for the Apple APIs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have something like that in my code: <?php foreach($clients as $client): ?> <tr
I have a php page that needs a modal confirmation. When clicking Please confirm
I have some PHP code that I'm trying to add a delete confirmation. But
I have a modal popup with several links inside that have the :confirm and
I have a bunch of ant projects that build plug-ins that all conform to
I have some php code for running a different mySQL queries based on an
I have a section of code that I need to remove from multiple files
I have this Table ,and fetching row using this php code ,when i click
I am pretty new to Php and I try to write some code that
For those who code in Notepad++, I just want to confirm that Notepad++ does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.