0

I'm running Nanohttpd inside my Android App. All works fine. The pages get served to my desktop browser.

But if I access the url using 127.0.0.1.. or 192.168.1.x.. from my chrome browser on the same android device, I get bad-gateway error. The issue is happening because of "Reduce Data Usage" option in Chrome's bandwidth management.

I used Chrome debugger and found the response - This page cannot be loaded via the Chrome Data Compression Proxy. Try reloading the page.

The problem is, this is a jQuery based request. Is there a workaround for this issue?

Makubex
  • 1,054
  • 1
  • 9
  • 16
  • What has jQuery to do with it? What's happening is you use a different webserver on your device? – greenapps Aug 07 '14 at 18:49
  • You have to disable the reduce data usage option as the google proxy is a server on the internet who has no access to your device. Having said that i wonder why the proxy would be invoked by Chrome for a localhost address. – greenapps Aug 07 '14 at 19:06
  • The Chrome browser on my device does not have that option and nonohttp does serve it very well. – greenapps Aug 07 '14 at 19:07
  • Like I said, it happens only when I enable it. I think NanoHttpd is checking for spoofing, that's just my guess. Wanted to know if there's a workaround – Makubex Aug 08 '14 at 12:34
  • No. The reason is as i explained earlier. – greenapps Aug 08 '14 at 12:36
  • You were right. http://stackoverflow.com/questions/24216646/chrome-data-compression-proxy-error-with-jquery-ajax-form-submission?lq=1 – Makubex Aug 08 '14 at 12:48
  • Chrome auto reloads get requests but not post, thats why my jquery requests are getting screwed – Makubex Aug 08 '14 at 12:49
  • You mean: automatically tries to reload the page using no proxy. Because what would help it using the proxy again? – greenapps Aug 08 '14 at 13:04
  • Yup. So what would you do in case of jquery post was the question.. user doesnt get the option to 'refresh' – Makubex Aug 08 '14 at 13:11
  • Well this is a design error in the Chrome browser which is using an internet proxy for sites on local addresses. Contact Google ;-). And sorry... I see no solution at the moment. – greenapps Aug 08 '14 at 13:17
  • Agree with you. Was looking for a work-around instead of asking users to disable it. Thanks for the help :) – Makubex Aug 08 '14 at 13:20

0 Answers0