Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-9407

function get_remote_file not working behind a proxy

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • 3.0.x
    • None
    • Other
    • None
    • PHP Environment: 5.2.4
      Database: MySQL 5.0.51

    Description

      The board I administrate is running on a computer that is behind a proxy. It would very useful if I could define some variables to tell php open connections using proxy itself, otherwise I can't do things like version check.
      It just needs a few lines to modify in functions_admin.php:

      function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port = 80, $timeout = 10)
      {
      global $user;

      // these line are just for example, variables shoult be placed in config!
      $proxy_host = 'dummyproxy.example.com';
      $proxy_port = '8080';
      $proxy_user = 'dummyuser';
      $proxy_pass = 'myDummyPassWord';

      // some more code is needed here, just some control to check if proxy is required or not...
      if ($fsock = @fsockopen($proxy_host, $proxy_port, $errno, $errstr, $timeout))

      { @fputs($fsock, 'Proxy-Authorization: Basic ' . base64_encode("$proxy_user:$proxy_pass") . "\r\n\r\n"); @fputs($fsock, "GET [http://$host$directory/$filename] HTTP/1.1\r\n"); @fputs($fsock, "HOST: $host\r\n"); @fputs($fsock, "Connection: close\r\n\r\n"); // [rest of code unchanged....] }

      Attachments

        Activity

          People

            Marc Marc
            garak garak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: