SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: noproxy script

  1. #1
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    noproxy script

    I have a php script that installed on my previous linux sever and work with proxy, but I want change it to work without proxy and use regular internet.
    Any ideas?

    <?php
    /* proxy server address*/
    $proxy = "***.***.***.***";
    /*proxy server port*/
    $port = "****";
    /*the url want to connect to*/
    $url = "**********.com";
    $fp = fsockopen($proxy, $port) or die("Unable to open");
    fputs($fp, "GET $url HTTP/1.1\r\nHost: $proxy\r\n\r\n");
    while(!feof($fp)){
    $line = fgets($fp, 4000);
    print($line);
    }
    fclose($fp);
    ?>

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    echo file_get_contents('http://www.example.com'); 


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •