ShadowSocks protocol fixes:

- remote for OpenVPN is set to real ip address
- remote ip will be added as alias in docker container
- ss-local graceful shutdown
- crash fixes
This commit is contained in:
pokamest 2021-03-18 18:45:08 +03:00
parent 84e4b776ac
commit d831d68e73
14 changed files with 173 additions and 65 deletions

View file

@ -4,18 +4,19 @@
#include <QRegExp>
#include <QString>
#ifdef Q_OS_WIN
#include "Windows.h"
#endif
class Utils {
public:
static QString configPath();
static QString defaultVpnConfigFileName();
static QString executable(const QString& baseName, bool absPath);
static QString serverName();
static QString systemLogPath();
static QString toString(bool value);
static bool createEmptyFile(const QString& path);
static bool initializePath(const QString& path);
static bool processIsRunning(const QString& fileName);
static QString getIPAddress(const QString& host);
static QString getStringBetween(const QString& s, const QString& a, const QString& b);
@ -23,6 +24,13 @@ public:
static QRegExp ipAddressRegExp() { return QRegExp("^((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])(\\.(?!$)|$)){4}$"); }
static QRegExp ipAddressPortRegExp() { return QRegExp("^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}"
"(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(\\:[0-9]{1,5}){0,1}$"); }
static bool processIsRunning(const QString& fileName);
static void killProcessByName(const QString &name);
#ifdef Q_OS_WIN
static bool signalCtrl(DWORD dwProcessId, DWORD dwCtrlEvent);
#endif
};
#endif // UTILS_H