added settings page for v2ray
This commit is contained in:
parent
68830021d6
commit
2b0ba2aff9
9 changed files with 176 additions and 38 deletions
|
|
@ -32,7 +32,7 @@ ErrorCode V2RayProtocol::start()
|
|||
|
||||
QStringList args = QStringList() << "-c" << m_v2RayConfigFile.fileName();
|
||||
|
||||
qDebug().noquote() << "ShadowSocksVpnProtocol::start()"
|
||||
qDebug().noquote() << "V2RayProtocol::start()"
|
||||
<< v2RayExecPath() << args.join(" ");
|
||||
|
||||
m_v2RayProcess.setProcessChannelMode(QProcess::MergedChannels);
|
||||
|
|
@ -41,14 +41,14 @@ ErrorCode V2RayProtocol::start()
|
|||
m_v2RayProcess.setArguments(args);
|
||||
|
||||
connect(&m_v2RayProcess, &QProcess::readyReadStandardOutput, this, [this](){
|
||||
qDebug().noquote() << "v2ray:" << m_v2RayProcess.readAllStandardOutput();
|
||||
qDebug().noquote() << "V2Ray:" << m_v2RayProcess.readAllStandardOutput();
|
||||
});
|
||||
|
||||
connect(&m_v2RayProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, [this](int exitCode, QProcess::ExitStatus exitStatus) {
|
||||
qDebug().noquote() << "V2RayProtocol finished, exitCode, exiStatus" << exitCode << exitStatus;
|
||||
setConnectionState(VpnProtocol::Disconnected);
|
||||
if (exitStatus != QProcess::NormalExit){
|
||||
emit protocolError(amnezia::ErrorCode::ShadowSocksExecutableCrashed); //todo
|
||||
emit protocolError(amnezia::ErrorCode::V2RayExecutableCrashed);
|
||||
stop();
|
||||
}
|
||||
if (exitCode != 0 ) {
|
||||
|
|
@ -64,8 +64,7 @@ ErrorCode V2RayProtocol::start()
|
|||
setConnectionState(VpnConnectionState::Connecting);
|
||||
|
||||
return OpenVpnProtocol::start();
|
||||
}
|
||||
else return ErrorCode::ShadowSocksExecutableMissing;
|
||||
} else return ErrorCode::V2RayExecutableMissing;
|
||||
#else
|
||||
return ErrorCode::NotImplementedError;
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue