As I described in a previous question, I have an assignment to write a proxy server. It partially works now, but I still have a problem with handling of gzipped information.
I had the same problem. I commented the line which adds the header accept gzip:
con.setRequestProperty("Accept-Encoding","gzip, deflate");
...and it worked!