Closed GoogleCodeExporter closed 9 years ago
am also trying to have proxy in curlio file but it is throwing out error.
Original comment by as885...@gmail.com
on 27 Aug 2013 at 5:55
Could you paste in an example of the code you're using and the error displayed?
Original comment by ianbar...@google.com
on 27 Aug 2013 at 2:44
Just before the $ch = curl_init(); in function makeRequest() in
Google_CurlIO.php, add these four lines to solve this issue:
curl_setopt($ch,CURLOPT_PROXYTYPE,CURLPROXY_HTTP);
curl_setopt($ch,CURLOPT_PROXY,$ProxyURL);
curl_setopt($ch,CURLOPT_PROXYPORT,$ProxyPort);
curl_setopt($ch,CURLOPT_PROXYUSERPWD,$ProxyUser);
Cédric
Original comment by cedric.clement@gmail.com
on 29 Aug 2013 at 8:38
You can do that with the setOptions method on CurlIO, no need to modify the
class itself.
Original comment by ianbar...@google.com
on 29 Aug 2013 at 10:10
Right, sorry...
Original comment by cedric.clement@gmail.com
on 29 Aug 2013 at 12:52
However, if the proxy add some http headers, you have to modify the makeRequest
method in order to get a correct JSON string via getResponseBody method, for
example (ugly) :
$respHeaderSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE) + 110;
where 110 match the length of added headers...
Original comment by cedric.clement@gmail.com
on 29 Aug 2013 at 1:51
A little bit smarter modifying the method authenticate in Google_OAuth2.php :
$ResponseBody = $request->getResponseBody();
$this->setAccessToken(substr($ResponseBody,strpos($ResponseBody,'{')));
Original comment by cedric.clement@gmail.com
on 29 Aug 2013 at 2:14
Looks like the header offset is being resolved in libcurl, which will fix
CURLINFO_HEADER_SIZE: https://github.com/bagder/curl/pull/60
Original comment by ianbar...@google.com
on 30 Aug 2013 at 12:08
You are right. The update from libcurl 7.24 to 7.30 (via the update of
considered PHP extension) solve the issue and patches in the code (curl and
rest) are not usefull anymore. Thanks a lot.
Cédric
Original comment by cedric.clement@gmail.com
on 31 Aug 2013 at 12:14
Original issue reported on code.google.com by
jesus.ca...@gmail.com
on 12 Aug 2013 at 9:29