hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From corpaul <koning...@live.nl>
Subject Question about creating a simple HTTP proxy
Date Wed, 26 Nov 2008 15:45:26 GMT

Hi,

I am trying to adjust the ReverseProxy example to build a (simple) HTTP
proxy. I need one to hook up to another Java application to see whether a
request was made and to which Host it was made, just for testing purposes.
My desire is not to build a production quality proxy (although it would be
nice if it worked correctly ;) ).

I have a couple of questions about this:

1. Do such proxies exist for HttpClient / Java? I kinda have the feeling I'm
reinventing the wheel here.
2. Is adjusting the ReverseProxy example a good idea or is this way too
naive?
3. The code I have thus far gives me the following error for AJAX calls:
Exception in thread "Thread-6" java.lang.IllegalStateException: Content has
been consumed
	at
org.apache.http.entity.BasicHttpEntity.getContent(BasicHttpEntity.java:84)
	at org.apache.http.entity.BasicHttpEntity.writeTo(BasicHttpEntity.java:126)
	at
org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:97)
	at
org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:164)
	at
org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:237)
	at
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:119)
	at usaproxytest.NHttpServer$HttpFileHandler.handle(NHttpServer.java:178)
	at org.apache.http.protocol.HttpService.doService(HttpService.java:243)
	at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:187)
	at usaproxytest.NHttpServer$WorkerThread.run(NHttpServer.java:272)
What does this imply?

Thanks in advance for your time!

Cor-Paul
-- 
View this message in context: http://www.nabble.com/Question-about-creating-a-simple-HTTP-proxy-tp20703487p20703487.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message