Closed GoogleCodeExporter closed 9 years ago
Both CLI and GUI version use the same configuration:
~/.rest-client/rest-client.properties
Use the GUI tool to configure the proxy details and quit it. This will update
this property file. After that when you run the CLI tool (without the -D proxy
details you have mentioned), it will read the proxy details from
~/.rest-client/rest-client.properties and use it.
Try it out and let me know.
Original comment by subwiz
on 4 Jul 2013 at 5:17
Thank you for your response.
I have tested this way yet - KO.
I have take a look in sources...I think in CLI mode, proxy config is ...never
set..compared to GUI way ;-)
I think a fix is needed - thanks in advance
Original comment by rodolphe...@gmail.com
on 5 Jul 2013 at 1:38
Thanks for letting me know. I will look into the code.
Original comment by subwiz
on 5 Jul 2013 at 3:41
This is the code:
http://code.google.com/p/rest-client/source/browse/restclient-lib/src/main/java/
org/wiztools/restclient/HTTPClientRequestExecuter.java
Line 126 onwards, you see that proxy is being considered. This is the same code
that is executed by both GUI and CLI version. Do you suspect any error over
here?
I don't have a proxy to test the scenario now.
Original comment by subwiz
on 5 Jul 2013 at 3:57
Yes, this code use ProxyConfig.getInstance(), and if enabled use it.
But, any method does init/set proxy parameters before...(instead of GUI mode)
Original comment by rodolphe...@gmail.com
on 8 Jul 2013 at 9:16
> any method does init/set proxy parameters before...(instead of GUI mode)
Sorry, right now, we do not have.
Original comment by subwiz
on 8 Jul 2013 at 9:26
I (on my own local clone) add these lines in
http://code.google.com/p/rest-client/source/browse/restclient-lib/src/main/java/
org/wiztools/restclient/HTTPClientRequestExecuter.java
and it works well !
IGlobalOptions options = (IGlobalOptions)
ServiceLocator.getInstance(IGlobalOptions.class);
options.acquire();
options.release();
ProxyConfig proxy = ProxyConfig.getInstance();
proxy.acquire();
try {
proxy.setEnabled(Boolean.valueOf(
options.getProperty("proxy.options.is_enabled"))
.booleanValue());
proxy.setHost(options.getProperty("proxy.options.host"));
proxy.setPort(Integer.parseInt(options
.getProperty("proxy.options.port")));
proxy.setAuthEnabled(Boolean.valueOf(
options.getProperty("proxy.options.is_auth_enabled"))
.booleanValue());
proxy.setUsername(options.getProperty("proxy.options.username"));
proxy.setPassword(options.getProperty("proxy.options.password")
.toCharArray());
} catch (Exception ex) {
ex.printStackTrace();
}
proxy.release();
Original comment by rodolphe...@gmail.com
on 8 Jul 2013 at 11:30
Can you attach your code to the issue? I will patch my code accordingly...
Original comment by subwiz
on 8 Jul 2013 at 4:16
Fixed:
https://code.google.com/p/rest-client/source/detail?r=1841388fbcabfd481d08dfe6aa
e459b8ff44e995
Can you please verify if my fix works for you? As I said earlier, I don't have
a proxy environment to test right now...
Original comment by subwiz
on 9 Jul 2013 at 6:36
Thanks. I think it should work !
How can I obtain a fixed JAR CLI ?
Original comment by rodolphe...@gmail.com
on 11 Jul 2013 at 11:13
Is it possible to get Guide Quick and Dirty pdf ;-) ?
Original comment by rodolphe...@gmail.com
on 11 Jul 2013 at 11:15
Fixed cli:
http://download.wiztools.org/rest-client/restclient-cli-3.2.1-SNAPSHOT-jar-with-
dependencies.jar
Let me know if it works.
Many of the content in the book is available here:
http://code.google.com/p/rest-client/w/list
Original comment by subwiz
on 11 Jul 2013 at 11:50
Original issue reported on code.google.com by
rodolphe...@gmail.com
on 4 Jul 2013 at 12:42