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

  • Home
  • SEARCH
  • 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 8594723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:15:52+00:00 2026-06-12T00:15:52+00:00

I am using a PHP script in Windows to make a curl request to

  • 0

I am using a PHP script in Windows to make a curl request to successfully make a SOAP request, and I’m trying to track down exactly how this successful request is made to replicate it in C#.NET.

How can I use PHP to detect which proxy server curl is going to use?

I was hoping there might be a curl_getopt in php curl, so I could do something like:

curl_getopt(CURLOPT_PROXY);

but alas it doesn’t exist.

Is there any way for me to find out which proxy server php curl will be connecting through?

  • 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-12T00:15:53+00:00Added an answer on June 12, 2026 at 12:15 am

    1. You tell curl what proxy to use, and not viaversa:

    function wget($url)
    {
        $options = array(
            CURLOPT_URL             => $url,
            CURLOPT_HEADER          => false,
            CURLOPT_FOLLOWLOCATION  => true,
            CURLOPT_RETURNTRANSFER  => true,
            CURLOPT_TIMEOUT         => 30,
            CURLOPT_PROXY           => '...proxy.ip...',
            CURLOPT_PROXYPORT       => '...proxy.port...',
            CURLOPT_USERAGENT       => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9',
        );
        $ch = curl_init();
        curl_setopt_array($ch, $options);
        $content = curl_exec($ch);
        $error = curl_error($ch);
        return (!$error && $content) ? $content : null;
    }
    

    2. Another solution >

    And look at this answer > How to get an option previously set with curl_setopt()?

    3. Override curl_setopt() function

    http://php.net/manual/en/function.override-function.php

    p.s. you should probably need http://php.net/manual/en/function.rename-function.php

    4. Use runkit to override functions

    http://php.net/manual/en/book.runkit.php

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

Sidebar

Related Questions

I am indexing a pdf file using this php script. The curl give me
I'm trying to send a POST request to a PHP script (http://mywebsite/index/test/ in this
Is it possible to make changes in mysql's my.ini file using PHP script?
I want to display an image using this php script on my server. $file
I am trying to make an ajax call to a php script. The php
I'm trying to use ajax to make multiple simultaneous requests to a php script,
I'm trying to make Jeditable works on new elements created using this jquery file
I am trying to send an e-mail using php script but i am getting
I'm trying to setup an Apache/PHP/Postgresql server locally on my machine. I'm using Windows
how to run a php when the current script finishes using curl ? cant

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.