-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid Proxyception. Bypassing the system proxy on the Android device when testing ping to the proxy. #69
Conversation
…when testing ping to the proxy. # Conflicts: # library/src/main/java/com/danikula/videocache/HttpProxyCacheServer.java
@ThatOdieGuy just wanted to say thanks for this and that I have merged it into my fork as well. If you have any more fixes you can also do a pull request on my fork and I'll merge it in and push it to bintray since you forked my fork @_@ and it looks like the original creator has abandoned the library. |
} catch (ProxyCacheException e) { | ||
Log.e(LOG_TAG, "Error reading ping response", e); | ||
//Don't try to use a proxy to access our proxy. Proxyception. | ||
HttpURLConnection connection = (HttpURLConnection) new URL(pingUrl).openConnection(Proxy.NO_PROXY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this fix resolves issue? Bypassing system proxy allows only ping cacheproxy, but MediaPlayer will not whatever.
@jarrodholliday @ThatOdieGuy Are you sure this PR resolves issue? Bypassing system proxy allows only ping cacheproxy, but MediaPlayer will not whatever. |
@danikula I tested this a bit more and it doesn't really solve the issue. When setting up the proxy on the phone for Charles I just tell it to bypass localhost and that works like a charm. |
Bypassing system proxy allows only ping cacheproxy, but MediaPlayer will not whatever. Fix doesn't work. |
Oh, it fixed the problem for us. AndroidVideoCache would just fail right off the bat because it couldn't pass the ping test. I bypassed the Charles proxy using this code and everything worked great. We're not using MediaPlayer though. We're using ExoPlayer. So maybe that's different? |
@ThatOdieGuy sounds strange. Will check it for MediaPlayer and ExoPlayer. Thanks for info. |
If you have a proxy setup on your device, the previous code for the ping would try to use that proxy, and that proxy would know nothing of the HttpProxyCacheServer. This would cause the ping to fail. And make it impossible to see what is going on with the network using a proxy. This code uses a HttpURLConnection with Proxy.NO_PROXY in order to not get intercepted by the system proxy.