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 3944362
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:53:29+00:00 2026-05-20T00:53:29+00:00

I have a list of proxies, need to use them in a php script

  • 0

I have a list of proxies, need to use them in a php script I am writing.

How can I test that the proxy will work before I use it? is that possible? at the moment if the proxy doesn’t work the script just dies after 30 seconds. Is there a quicker way to identify whether it will work or not?

perhaps create a socket connection? send something to it that will reveal whether the proxy is open?

thanks

  • 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-05-20T00:53:29+00:00Added an answer on May 20, 2026 at 12:53 am

    you can use fsockopen for this, where you can specify a timeout.

    A simple proxy list checker. You can check a list ip:port if that port is opened on that IP.

    <?php
    
    $fisier = file_get_contents('proxy_list.txt'); // Read the file with the proxy list
    $linii = explode("\n", $fisier); // Get each proxy
    $fisier = fopen("bune.txt", "a"); // Here we will write the good ones
    
    for($i = 0; $i < count($linii) - 1; $i++) test($linii[$i]); // Test each proxy
    
    function test($proxy)
    {
      global $fisier;
      $splited = explode(':',$proxy); // Separate IP and port
      if($con = @fsockopen($splited[0], $splited[1], $eroare, $eroare_str, 3)) 
      {
        fwrite($fisier, $proxy . "\n"); // Check if we can connect to that IP and port
        print $proxy . '<br>'; // Show the proxy
        fclose($con); // Close the socket handle
      }
    }
    
    fclose($fisier); // Close the file
    
    ?>
    

    you may also want to use set_time_limit so that you can run your script for longer.

    Code taken from: http://www.php.net/manual/en/function.fsockopen.php#95605

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

Sidebar

Related Questions

I have a list of proxy ip's that I want to use in one
i have list of rows that user select and i want to delete them,
I have list of catalog paths and need to filter out some of them.
I have List<Product[]> and I need to join them into one Product[] .
So i have a listbox that i have there for a list of proxies.
I have list of text that contain double quoate and upderscore. How can I
I have a list of 100 proxies. The URL I am interested in is
I have list of words. I type in a word misspelled. Can I query
I have to fetch content of some urls by using proxies from a list.
The Objective : A script which cycles through a list of proxies and sends

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.