Token secured remote server for websockify
This commit is contained in:
parent
2b5b5c22f2
commit
f13345e0f2
3 changed files with 160 additions and 52 deletions
|
|
@ -23,14 +23,21 @@
|
|||
#include <QLocalSocket>
|
||||
#include <QObject>
|
||||
|
||||
struct SMSubServerSettings
|
||||
{
|
||||
bool canRegister;
|
||||
bool isLocal;
|
||||
};
|
||||
|
||||
class SMSubServer : public QLocalServer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SMSubServer(const QString &socket);
|
||||
SMSubServer(SMSubServerSettings *serverSettings, const QString &socket);
|
||||
|
||||
public slots:
|
||||
void writeOutput(const QByteArray &output);
|
||||
void registerToken(const QString &token);
|
||||
|
||||
private slots:
|
||||
void incomingConnection(quintptr socketDescriptor);
|
||||
|
|
@ -39,9 +46,12 @@ private slots:
|
|||
|
||||
private:
|
||||
inline void debugOutput(QLocalSocket *socket, const QByteArray &message);
|
||||
SMSubServerSettings *serverSettings;
|
||||
QVector<QLocalSocket*> sockets;
|
||||
QVector<QString> tokens;
|
||||
|
||||
signals:
|
||||
void tokenRegistered(const QString &password);
|
||||
void inputWritten(const QByteArray &input);
|
||||
void killRequested();
|
||||
void stopRequested();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue