Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (34 sloc) 1.358 kb
#ifndef QNETWORKPROXYFACTORYEXENDFORPAC_H
#define QNETWORKPROXYFACTORYEXENDFORPAC_H
#include <QNetworkProxyFactory>
#include <QScriptEngine>
class QNetworkProxyFactoryExendForPAC : public QObject
{
Q_OBJECT
public:
QNetworkProxyFactoryExendForPAC();
~QNetworkProxyFactoryExendForPAC();
/**
* Call this to set the script to be executed. Note that the argument should be
* the content of the .pac file to be used, not the URL where it is located.
*/
void setConfig( const QString &config );
/**
* Returns the result
*/
Q_SCRIPTABLE QString findProxyForUrl( const QString &url, const QString &host );
private:
void install();
static QScriptValue debug( QScriptContext *context, QScriptEngine *engine );
/* String myIpAddress */
static QScriptValue myIpAddress( QScriptContext *context, QScriptEngine *engine );
/* bool isInNet ipaddress, netaddress, netmask */
static QScriptValue isInNet( QScriptContext *context, QScriptEngine *engine );
/* bool shExpMatch url, glob */
static QScriptValue shExpMatch( QScriptContext *context, QScriptEngine *engine );
/* string dnsResolve hostname */
static QScriptValue dnsResolve( QScriptContext *context, QScriptEngine *engine );
private:
QScriptEngine *engine;
};
#endif // QNETWORKPROXYFACTORYEXENDFORPAC_H
Jump to Line
Something went wrong with that request. Please try again.