diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2019-06-30 10:59:52 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2019-06-30 10:59:52 +0000 |
| commit | 0535efd70fb085c5a4fdf5ecab0b87bb93f81407 (patch) | |
| tree | bf9d49b0164ba30eb9b13d226520fa27d8cc4fe6 /src/plugins | |
| parent | 1450510b7eddfbb15124fb004c101af7feab204b (diff) | |
| download | qmmp-0535efd70fb085c5a4fdf5ecab0b87bb93f81407.tar.gz qmmp-0535efd70fb085c5a4fdf5ecab0b87bb93f81407.tar.bz2 qmmp-0535efd70fb085c5a4fdf5ecab0b87bb93f81407.zip | |
added socks5 proxy support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@8971 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins')
| -rw-r--r-- | src/plugins/General/lyrics/lyricswindow.cpp | 2 | ||||
| -rw-r--r-- | src/plugins/General/scrobbler/scrobbler.cpp | 4 | ||||
| -rw-r--r-- | src/plugins/General/streambrowser/streamwindow.cpp | 2 | ||||
| -rw-r--r-- | src/plugins/Input/cdaudio/decoder_cdaudio.cpp | 2 | ||||
| -rw-r--r-- | src/plugins/Transports/http/httpstreamreader.cpp | 7 |
5 files changed, 16 insertions, 1 deletions
diff --git a/src/plugins/General/lyrics/lyricswindow.cpp b/src/plugins/General/lyrics/lyricswindow.cpp index 17fe95109..0ef6c83d6 100644 --- a/src/plugins/General/lyrics/lyricswindow.cpp +++ b/src/plugins/General/lyrics/lyricswindow.cpp @@ -47,6 +47,8 @@ LyricsWindow::LyricsWindow(const QString &artist, const QString &title, QWidget if (gs->isProxyEnabled()) { QNetworkProxy proxy(QNetworkProxy::HttpProxy, gs->proxy().host(), gs->proxy().port()); + if(gs->proxyType() == QmmpSettings::SOCKS5_PROXY) + proxy.setType(QNetworkProxy::Socks5Proxy); if(gs->useProxyAuth()) { proxy.setUser(gs->proxy().userName()); diff --git a/src/plugins/General/scrobbler/scrobbler.cpp b/src/plugins/General/scrobbler/scrobbler.cpp index 07f33e72d..9c8a9a0ea 100644 --- a/src/plugins/General/scrobbler/scrobbler.cpp +++ b/src/plugins/General/scrobbler/scrobbler.cpp @@ -268,6 +268,8 @@ void Scrobbler::setupProxy() if (gs->isProxyEnabled()) { QNetworkProxy proxy(QNetworkProxy::HttpProxy, gs->proxy().host(), gs->proxy().port()); + if(gs->proxyType() == QmmpSettings::SOCKS5_PROXY) + proxy.setType(QNetworkProxy::Socks5Proxy); if(gs->useProxyAuth()) { proxy.setUser(gs->proxy().userName()); @@ -399,6 +401,8 @@ ScrobblerAuth::ScrobblerAuth(const QString &scrobblerUrl, const QString &authUrl if (gs->isProxyEnabled()) { QNetworkProxy proxy(QNetworkProxy::HttpProxy, gs->proxy().host(), gs->proxy().port()); + if(gs->proxyType() == QmmpSettings::SOCKS5_PROXY) + proxy.setType(QNetworkProxy::Socks5Proxy); if(gs->useProxyAuth()) { proxy.setUser(gs->proxy().userName()); diff --git a/src/plugins/General/streambrowser/streamwindow.cpp b/src/plugins/General/streambrowser/streamwindow.cpp index 504914025..dc276e872 100644 --- a/src/plugins/General/streambrowser/streamwindow.cpp +++ b/src/plugins/General/streambrowser/streamwindow.cpp @@ -96,6 +96,8 @@ StreamWindow::StreamWindow(QWidget *parent) if (gs->isProxyEnabled()) { QNetworkProxy proxy(QNetworkProxy::HttpProxy, gs->proxy().host(), gs->proxy().port()); + if(gs->proxyType() == QmmpSettings::SOCKS5_PROXY) + proxy.setType(QNetworkProxy::Socks5Proxy); if(gs->useProxyAuth()) { proxy.setUser(gs->proxy().userName()); diff --git a/src/plugins/Input/cdaudio/decoder_cdaudio.cpp b/src/plugins/Input/cdaudio/decoder_cdaudio.cpp index 11e8119ab..afc6b2995 100644 --- a/src/plugins/Input/cdaudio/decoder_cdaudio.cpp +++ b/src/plugins/Input/cdaudio/decoder_cdaudio.cpp @@ -252,7 +252,7 @@ QList<CDATrack> DecoderCDAudio::generateTrackList(const QString &device, TrackIn { cddb_http_enable (cddb_conn); cddb_set_http_path_query (cddb_conn, settings.value("cddb_path").toByteArray().constData()); - if (QmmpSettings::instance()->isProxyEnabled()) + if (QmmpSettings::instance()->isProxyEnabled() && QmmpSettings::instance()->proxyType() == QmmpSettings::HTTP_PROXY) { QUrl proxy = QmmpSettings::instance()->proxy(); cddb_http_proxy_enable (cddb_conn); diff --git a/src/plugins/Transports/http/httpstreamreader.cpp b/src/plugins/Transports/http/httpstreamreader.cpp index 5cba24d0c..0cefbe775 100644 --- a/src/plugins/Transports/http/httpstreamreader.cpp +++ b/src/plugins/Transports/http/httpstreamreader.cpp @@ -325,12 +325,19 @@ void HttpStreamReader::run() m_handle = curl_easy_init(); //proxy if (QmmpSettings::instance()->isProxyEnabled()) + { curl_easy_setopt(m_handle, CURLOPT_PROXY, strdup((QmmpSettings::instance()->proxy().host() + ":" + QString("%1").arg(QmmpSettings::instance()->proxy().port())). toLatin1 ().constData ())); + + if(QmmpSettings::instance()->proxyType() == QmmpSettings::SOCKS5_PROXY) + curl_easy_setopt(m_handle, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); + } else + { curl_easy_setopt(m_handle, CURLOPT_NOPROXY, "*"); + } if (QmmpSettings::instance()->useProxyAuth()) curl_easy_setopt(m_handle, CURLOPT_PROXYUSERPWD, |
