HTTP Status Code 407 | Proxy Authentication Required

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • austriancoder
    replied
    As PTS is using stream_context_create(..) the correct solution would be something like:

    PHP Code:
    $auth base64_encode('LOGIN:PASSWORD');

    $aContext = array(
        
    'http' => array(
            
    'proxy' => 'tcp://192.168.0.2:3128',
            
    'request_fulluri' => true,
            
    'header' => "Proxy-Authorization: Basic $auth",
        ),
    );
    $cxContext stream_context_create($aContext);

    $sFile file_get_contents("http://www.google.com"False$cxContext);

    echo 
    $sFile
    see http://stackoverflow.com/questions/1...behind-a-proxy

    Leave a comment:


  • austriancoder
    replied
    As PTS is using stream_context_create(..) the correct way to fix this would be something like:

    PHP Code:
    $auth base64_encode('LOGIN:PASSWORD');

    $aContext = array(
        
    'http' => array(
            
    'proxy' => 'tcp://192.168.0.2:3128',
            
    'request_fulluri' => true,
            
    'header' => "Proxy-Authorization: Basic $auth",
        ),
    );
    $cxContext stream_context_create($aContext);

    $sFile file_get_contents("http://www.google.com"False$cxContext);

    echo 
    $sFile
    see http://stackoverflow.com/questions/1...behind-a-proxy

    Leave a comment:


  • Michael
    replied
    Originally posted by austriancoder View Post
    Hi all.

    I am in the bad situation at I need to do proxy authentication to get access to http/https. PTS supports some kind of
    proxy configurations - proxy and port - but that is not enough for network environment.
    It would be great to add support for username and password to the current proxy support in PTS.

    To access the internet I need to provide Chrome a proxy URL which looks like:
    http://userassword@urlort

    Thanks
    ac

    Have you tried editing your system's php.ini file directly? I think it should offer such proxy configuration from there.

    -- Michael

    Leave a comment:


  • austriancoder
    started a topic HTTP Status Code 407 | Proxy Authentication Required

    HTTP Status Code 407 | Proxy Authentication Required

    Hi all.

    I am in the bad situation at I need to do proxy authentication to get access to http/https. PTS supports some kind of
    proxy configurations - proxy and port - but that is not enough for network environment.
    It would be great to add support for username and password to the current proxy support in PTS.

    To access the internet I need to provide Chrome a proxy URL which looks like:
    http://userassword@urlort

    Thanks
    ac
Working...
X