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
Support per-stream proxies in HLS streams (attempt 5) #9421
Conversation
Please force-push instead of opening new pull requests. When you rewrite history and force-push to a branch of the same name, github will automatically update the PR. Note that any comments directly attached to old commits will be hidden (but still viewable) |
if (selected.compare(m_item.GetPath()) != 0) | ||
const CURL playlist_url = m_item.GetURL(); | ||
const CURL selected = PLAYLIST::CPlayListM3U::GetBestBandwidthStream(playlist_url, bandwidth); | ||
if (selected.Get().compare(playlist_url.Get()) != 0) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I went through the code and it looks like you're on the right track. Good job. |
{ | ||
const std::string type_str = GetProxyType(); | ||
CCurlFile::ProxyType type = CCurlFile::PROXY_HTTP; | ||
if (type_str == "http") |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I agree with @garbear and only have this single comment. Then it is good to go 👍 |
Formatting the CURL as a string, then parsing it back to a CURL is redundant, and has the effect of stripping any additional CURL object metadata.
Since v3.0, FFmpeg has supported the http_proxy option for the HTTP protocol. Previously, CDVDDemuxFFmpeg would pass Kodi httpproxy CURL protocol option through as a HTTP header, which the server would (hopefully) ignore. With this change, if Kodi is built with an older version of FFmpeg, FFmpeg will simply ignore the option - which is an improvement over sending spurious HTTP headers.
@garbear @FernetMenta - now updated |
@jhol thank you very much! |
@jhol congrats and thanks again |
Support per-stream proxies in HLS streams (attempt 5)
|
||
// Select the standard port | ||
const std::string value = GetProxyType(); | ||
if (value == "socks4" && value == "socks4a" && |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Is there any documentation or examples on how to use these proxy properties in a strm file? I tried "CFileItem.proxy.host" and it didn't work. EDIT: I got it working with "proxy.host", the problem though for m3u8 it seems to only affect the playlist while http URLs that redirect to https don't use the proxy. And I couldn't get it to work with socks5. |
This branch supercedes #9412, #9398, #9240 and #8680, providing another attempt to add the ability for plugins to provide per-stream proxy configuration, including support for proxies with HLS.
The flow of URL information from plugins to HTTP requests for HLS streams is as follows:
To enable per-stream proxy configuration, the five config values (proxy protocol, host, port, user-name and password) must follow the same path-ways.
CFileItem
properties:proxy.type
,proxy.host
,proxy.port
,proxy.user
andproxy.password
.GetProxyType
etc.) have been added toCDVDInputStreamFFmpeg
, which expose these property values.CPlayListM3U::GetBestBandwidthStream
has been moved toCDVDInputStreamFFmpeg
, so that it can gain access to the proxy information fromCDVDInputStreamFFmpeg
.CFile::Open
factory mechanism has been removed from this method. InsteadCCurlFile
is created directly, so that the proxy values can be applied to the object.CDVDDemuxFFmpeg
has access toCDVDInputStreamFFmpeg
, and adds thehttp_proxy
string to the options dictionary if one has been specified.