开发者

How to configure freebase java client to connect through a proxy?

I am looking for a way to configure the freebase java api to connect to freebase through a proxy. I have set up sytem properties

System.setProperty("http.proxyHost", "proxy"); 
System.setProperty("http.proxyPort", "8080");
System.setProperty("http.proxySet", "true"); 

but it doesn't have any 开发者_StackOverfloweffect. Could anybody help?


It could be that an authentication is required, in this case please add

System.setProperty( "http.proxyUser", "user" );
System.setProperty( "http.proxyPassword", "password" );

or the hostname (proxy) isn't resolve this could be checked by ping hostname, you could add the IP-address instead. For further anaysis you should add the stacktrace of your exception.

HttpURLConnection has a method isUsingProxy() which could be useful for diagnostic log messages.

Further details you might find here


Nop, it does not work. I do not need to do authentication. I have found another solution. I have modified the freebase client -- the source code is freely available. The freebase client uses HttpClient4 , so you need to create HttpProxy object (and set your proxy details), and provide it to HttpClient.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜