Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jb40059' into 'master'
[ssu] Allow to use ssu behind proxy without connman. Contribute to JB#40059

See merge request !15
  • Loading branch information
pvuorela committed Nov 28, 2017
2 parents c4875af + f42fd9a commit ac93ab3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions libssunetworkproxy/ssunetworkproxy.h
Expand Up @@ -7,14 +7,24 @@

#ifndef _LibSsuNetworkProxy_H
#define _LibSsuNetworkProxy_H

#include <dlfcn.h>

#include <QtCore/QtGlobal>
#include <QtNetwork/QNetworkProxyFactory>

/**
* Set application proxy if the required library is found, otherwise
* do nothing.
* Set application proxy. First check \c http_proxy environment variable, then try to get
* proxy configuration from connman.
*/
inline void set_application_proxy_factory()
{
if (qEnvironmentVariableIsSet("http_proxy")) {
qDebug() << "Got http_proxy from environment, will not talk to connman";
QNetworkProxyFactory::setUseSystemConfiguration(true);
return;
}

void *proxylib = dlopen("libssunetworkproxy.so", RTLD_LAZY);
if (proxylib) {
typedef void (*ssuproxyinit_t)();
Expand Down

0 comments on commit ac93ab3

Please sign in to comment.