PHP Classes

proxy

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  How to Implement PHP ...  >  All threads  >  proxy  >  (Un) Subscribe thread alerts  
Subject:proxy
Summary:proxy requests
Messages:7
Author:Krull Korg
Date:2014-11-13 09:52:48
 

  1. proxy   Reply   Report abuse  
Picture of Krull Korg Krull Korg - 2014-11-13 09:52:48
is there a way to proxy oauth-api requests (in particular callapi)?

PS: sorry if it is a duplicate request but i can't find a way to search on forum... why don't you use github (or something similar as sourceforge)?

thanks in advance

  2. Re: proxy   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-11-13 21:12:16 - In reply to message 1 from Krull Korg
Yes, the HTTP class supports several types of proxy but its options are not exposed by the OAuth class.

Anyway, what kind of proxy do you want to use? Is it a regular HTTP proxy or maybe a SOCKS proxy?

PS. to search the forums you just need to use the regular site search. If there are any results in the forums, there will be a special tab in the results pages that says Package forums.

Restricting the results to only this package forums would be a good idea too, if that is what you want.

  3. Re: proxy   Reply   Report abuse  
Picture of Krull Korg Krull Korg - 2014-11-14 12:07:44 - In reply to message 2 from Manuel Lemos
regular http proxy

  4. Re: proxy   Reply   Report abuse  
Picture of Krull Korg Krull Korg - 2015-02-05 12:10:02 - In reply to message 3 from Krull Korg
so how can i set the proxy in http class inside oauth?

  5. Re: proxy   Reply   Report abuse  
Picture of Krull Korg Krull Korg - 2015-02-05 15:27:49 - In reply to message 4 from Krull Korg
i tried to change oauth_client.php setting $http->proxy_host_name and $http->proxy_host_port in SendAPIRequest (at line 1413) but callAPI replies that the request is invalid

instead it returns the right value if i put the same address in the browser, which use the same proxy

  6. Re: proxy   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-02-05 17:48:26 - In reply to message 4 from Krull Korg
Sorry for the delay. I have been very busy without much time to work on this class. I will try to add those options soon.

  7. Re: proxy   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-02-06 06:21:52 - In reply to message 5 from Krull Korg
I just added the http_arguments variable so you can set the ProxyHostName, ProxyHostPort and other options for the HTTP client class.

I could make it work for APIs that take HTTP requests like for instance Tumblr, but not yet for APIs that require HTTPS. Take a look at the login_with_tumblr.php for an example.

phpclasses.org/package/7700-PHP-Aut ...

As for APIs that require HTTPS, I could not yet figure what is the issue. The problem may be in the HTTP client class.

For now my difficulty is that I do not have a reliable proxy that I can try and see what is wrong.

What happens is that the HTTP client class connects to the proxy, then instructs the proxy to connect to the remote host, the starts the SSL cryptography layer successfully. However when it sends the actual HTTP request, the remote server says 400 Bad request.

I need more time to study the problem. Meanwhile if you figure any details, just let me know.