JavierSolis / resting

Automatically exported from code.google.com/p/resting
0 stars 0 forks source link

Proxy settings #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. My application does not handle any http(s) connections
2. application is behind a proxy server plus authentication is required
3.

What is the expected output? What do you see instead?
Connection fails

What version of the product are you using? On what operating system?
all

Please provide any additional information below.
Basically I need to know if there is a way of setting the proxy server settings 
in the RESTING api:
- proxy server
- port 
- username (perhaps optionally)
- password (perhaps optionally)

Perhaps, (but not important in my case), protocol related that is http vs https 
etc

Original issue reported on code.google.com by dembare...@gmail.com on 13 Sep 2011 at 1:47

GoogleCodeExporter commented 9 years ago
I'll handle this one. To be fixed in 0.7 release

Original comment by sujata...@gmail.com on 15 Sep 2011 at 3:12

GoogleCodeExporter commented 9 years ago
Cool thanks for now, I've just done a quick hacked your method invoke in
RESTClient class to cater for proxy settings. Worked fine for my demo but
certainly could be done better. Will wait for you version 7.

I just did something like:

if(Resting.proxyOn){
            String proxy_server = Resting.proxyServer;
            int proxy_port = Resting.proxyPort;
            UsernamePasswordCredentials creds = new
UsernamePasswordCredentials(Resting.proxy_user,Resting.proxy_pwd);
            AuthScope arg0 = new AuthScope(proxy_server,proxy_port);

            CredentialsProvider cp = new BasicCredentialsProvider();
            cp.setCredentials(arg0, creds);

            httpClient.setCredentialsProvider(cp);
            HttpHost proxy = new HttpHost(proxy_server, proxy_port);

httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,
            proxy);
 } //end if proxy on

-- 
Regards

Jay

Original comment by dembare...@gmail.com on 15 Sep 2011 at 3:39

GoogleCodeExporter commented 9 years ago
Assigned to Priya.

Original comment by sujata...@gmail.com on 16 Apr 2012 at 8:30

GoogleCodeExporter commented 9 years ago
How can I use Resting behind proxy servers? Please assist me.

Original comment by arsenalnerk on 30 Jul 2013 at 2:45

GoogleCodeExporter commented 9 years ago
The change for this is checked in

Original comment by sujata...@gmail.com on 31 Jul 2013 at 4:25