Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

added: url option to set proxy for http streams #2003

Closed
wants to merge 3 commits into from

5 participants

@queeup

Hi,
this is my first trial for contribute to xbmc code. I don't have build environment and I couldn't build and try this code. It should work I guess :)

I did it for using proxy without enable for hole XBMC. For add-on's mainly.

I need some feedbacks about this feature. Is it necessary or how is the code etc.

TODO: [DONE] Better log message to distinguish from XBMC proxy settings ("Using url option proxy %s")

@Memphiz
Owner

That won't work. "Equals" matches the whole string. You want to match only the start of it i guess?

Ahhh ok. I add that just for if somebody add it proxy like with http://ip:port.

What do you suggest? I can do it like here
Force to use |Proxy=ip:port instead of Proxy=http://ip:port

value.Left(strlen("http://")).Equals("http://")

Also... single quotes are used for characters in C... double quotes are for strings.

And don't forget to put everything that belongs into "else if" in between curly brackets.

I missed that single quotes. Python habit :) thankx for the "else if" brackets also. Noob C mistakes

@queeup

or keep it like it is and fix with value.Left(7).Equals("http://")

queeup fix nood coding mistakes.
-"Equals" matches the whole string.
-double quotes are for strings.
-forgotten "else if" parenthesis (curly brackets).
2965d08
@arnova
Collaborator

Pull requests are not supposed to be used to tutor people C++ and/or have it as a shortcut to get features implemented, especially if you can't even compile. This is what the forum is for. Just my 2c.

@queeup

What can I say, you are totally right. Fell free to close this pull request.

@MartijnKaijser

@queeup
are you still willing to work on this?

@queeup

No :( I am very busy with my daily life.

@MartijnKaijser

@ulion
perhaps you are interested in parts of this code?

@queeup
let me close this for now. once you have some time feel free to open a new PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 29, 2012
  1. fix nood coding mistakes.

    queeup authored
    -"Equals" matches the whole string.
    -double quotes are for strings.
    -forgotten "else if" parenthesis (curly brackets).
This page is out of date. Refresh to see the latest.
Showing with 17 additions and 0 deletions.
  1. +17 −0 xbmc/filesystem/CurlFile.cpp
View
17 xbmc/filesystem/CurlFile.cpp
@@ -716,6 +716,23 @@ void CCurlFile::ParseAndCorrectUrl(CURL &url2)
SetCookie(value);
else if (name.Equals("Encoding"))
SetContentEncoding(value);
+ else if (name.Equals("Proxy") && !g_guiSettings.GetBool("network.usehttpproxy"))
+ {
+ if (name.Equals("ProxyUserPass"))
+ {
+ SetProxyUserPass(value);
+ }
+ if (value.Left(7).Equals("http://"))
+ {
+ m_proxy = value;
+ }
+ else
+ {
+ m_proxy = "http://" + value;
+ }
+ SetProxy(m_proxy);
+ CLog::Log(LOGDEBUG, "Using url option proxy %s", m_proxy.c_str());
+ }
else if (name.Equals("noshout") && value.Equals("true"))
m_skipshout = true;
else
Something went wrong with that request. Please try again.