php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #67994 Add an option to declare a proxy to be used by the curl calls
Submitted: 2014-09-10 09:19 UTC Modified: 2014-09-14 04:55 UTC
From: samantha dot halfon at gmail dot com Assigned:
Status: Open Package: oauth (PECL)
PHP Version: 5.4.32 OS: Debian Wheezy
Private report: No CVE-ID: None
 [2014-09-10 09:19 UTC] samantha dot halfon at gmail dot com
Description:
------------
I wasn't able to find any option in the documentation enabling me to use a proxy in the curl calls. Tests using the stream method (with stream_context_set_default to declare the proxy) failed as well. 


Test script:
---------------
        /*$default_opts = array(
            'http'=>array(
                'method'=>"GET",
                'header'=>"Accept-language: en\r\n" .
                "Cookie: foo=bar",
                'proxy'=>"http://192.168.0.30:3128"
            )
        );

        $default = stream_context_set_default($default_opts);*/

        $this->_oauth = new \OAuth($options['consumerKey'], $options['consumerSecret']);
$this->_oauth->getRequestToken($this->_options['requestTokenUrl'], $this->_options['callbackUrl']);


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-09-14 04:55 UTC] datibbaw@php.net
Have you tried setting the request engine?

$this->_oauth-> setRequestEngine (OAUTH_REQENGINE_STREAMS);
 [2014-09-15 13:21 UTC] samantha dot halfon at gmail dot com
Sorry, it's missing in the code sample but yes, I had this line in my code as well

$this->_oauth-> setRequestEngine (OAUTH_REQENGINE_STREAMS);

Thanks
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 23:01:29 2024 UTC