forked from AlloyTeam/Rythem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qnetworkproxyfactoryexendforpac.h
50 lines (34 loc) · 1.33 KB
/
qnetworkproxyfactoryexendforpac.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#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