Configure a proxy for the traffic
See original GitHub issueHello, thanks for the amazing library. I was wondering if it is possible to configure a proxy for the player.
I can easily setup a proxy for some HttpURLConnection
I’m performing but now I would like to route the traffic of the player itself through the same proxy.
Any advice on the subject will be much appreciated.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Use a proxy server in Windows - Microsoft Support
Select the Start button, then select Settings > Network & internet > Proxy. Under Automatic proxy setup, turn on Automatically detect settings.
Read more >How to Set Up a Proxy Server on Your PC, Mac, or Web Browser
Click Start and select Settings (the gear icon) from the Start menu. · Choose Network & Internet. · Click Proxy in the left...
Read more >Setting up a Proxy Server for traffic monitoring with Tshark
A proxy is used for more than privacy, this tool helps to bypass filters, logging, and eavesdropping, caching, filtering blocking, manipulate and modify...
Read more >Forward Proxy — Apache Traffic Server 9.1.3 documentation
Forward proxies act as a gatekeeper between client browsers on your local network and all (or some, at your configuration's discretion) web sites...
Read more >Traffic Forwarding Via Direct Proxy Or PAC - Comodo Help
Open Internet Explorer · Open 'Tools' > 'Internet Options', open the 'Connections' tab and click 'LAN settings' · Select 'Use a proxy server...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kim-vde Thank you very much for your suggestions, they put me on the right direction. I was finally able to make a
MediaSource
with a proxy connection. I struggled a lot withHttpURLConnection
because on android it has limitations that are not present in a normal JVM. In particular the following global variables:are ignored in android. I was also trying to use the
Proxy
class:for each single connection but I hit a hard wall when i tryed to swith to an authentication proxy:
the Exception I was getting was:
In the end, your answer put me on the right track because while i was searching for a way to implement my own
DefaultHttpDataSource
I came accrossOkHttpClient
and its ExoPlayer extension. For me it was much easier to setupOkHttpClient
with proxy, after adding my client to the mentioned extension everything started to work flawlessy. For future reference here is my code for a proxied HLS stream:I hope this will help someone else in the future. Regards
Here is some information that could help:
DefaultHttpDataSource
by default, which in turn uses anHttpURLConnection
. If you set up the proxy forHttpURLConnection
by configuring some global properties somewhere, then this approach should also work with ExoPlayer, as long as you are not using an otherDataSource
.HttpURLConnection
instance directly, then you could try to use a customDataSource
extending theDefaultHttpDataSource
.If this doesn’t help, please provide more information, such as:
HttpURLConnection
?DataSource
such asDefaultHttpDataSource
,OkHttpDataSource
orCronetDataSource
?