Connection use Proxy

4 views
Skip to first unread message

Hagen

unread,
Feb 10, 2010, 6:40:49 PM2/10/10
to java-twitter
Hello can some one tell how to use proxy with this library. I try
write something but it is not work correctly.
HttpClient client=new HttpClient();
client.getHostConfiguration().setProxy(proxyHost, proxyPort);
client.getHttpConnectionManager();

HttpConnectionManager
connectionManager=client.getHttpConnectionManager();

TwitterHttpManager
manager=TwitterHttpManager.builder().httpConnectionManager(connectionManager).username(userName).password(pass).build();

Api api = Api.builder().httpManager(manager).build();

Fabian Taubald

unread,
Feb 10, 2010, 11:02:45 PM2/10/10
to java-t...@googlegroups.com
Can you give more detailed information about what is not working
correctly (maybe exception messages or something)? I think there is an
error in the third row of your code. The HttpConnectionManager-Object
instantiated with "client.getHttpConnectionManager()" is not assigned to
a valid variable. This happens in the next row (assigned to
connectionManager). Maybe this is just an copy / paste -error?

By the way, I recommend to use twitter4j. This is another official
Twitter-API for Java but in my opinion it is more comfortable to use
than java-twitter.

Regards,
Fabian

Hagen schrieb:

Reply all
Reply to author
Forward
0 new messages