diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2010-05-09 11:54:22 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2010-05-09 11:54:22 +0200 |
commit | 550fe90708c223ba65e7375ab8b822917ca903c3 (patch) | |
tree | 7a81e79c20fd2ea3494401f76fbd4eecfcfafae0 /src/main.c | |
parent | 97e2e779b196621117bfb73c4be61ae9a0b2be30 (diff) | |
download | pianobar-550fe90708c223ba65e7375ab8b822917ca903c3.tar.gz pianobar-550fe90708c223ba65e7375ab8b822917ca903c3.tar.bz2 pianobar-550fe90708c223ba65e7375ab8b822917ca903c3.zip |
HTTP proxy support
control_proxy pipes xmlrpc data through the proxy, this one is for the
music too.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -123,8 +123,15 @@ int main (int argc, char **argv) { settings.password = strdup (passBuf); } - /* setup control connection */ - if (settings.controlProxy != NULL) { + /* set up proxy (control proxy for non-us citizen or global proxy for poor + * firewalled fellows) */ + if (settings.proxy != NULL && strlen (settings.proxy) > 0) { + char tmpPath[2]; + WaitressSplitUrl (settings.proxy, waith.proxyHost, + sizeof (waith.proxyHost), waith.proxyPort, + sizeof (waith.proxyPort), tmpPath, sizeof (tmpPath)); + } else if (settings.controlProxy != NULL) { + /* global proxy overrides control proxy */ char tmpPath[2]; WaitressSplitUrl (settings.controlProxy, waith.proxyHost, sizeof (waith.proxyHost), waith.proxyPort, @@ -267,6 +274,17 @@ int main (int argc, char **argv) { WaitressInit (&player.waith); WaitressSetUrl (&player.waith, playlist->audioUrl); + /* set up global proxy, player is NULLed on songfinish */ + if (settings.proxy != NULL) { + char tmpPath[2]; + WaitressSplitUrl (settings.proxy, + player.waith.proxyHost, + sizeof (player.waith.proxyHost), + player.waith.proxyPort, + sizeof (player.waith.proxyPort), tmpPath, + sizeof (tmpPath)); + } + player.gain = playlist->fileGain; player.audioFormat = playlist->audioFormat; |