mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 13:50:12 +08:00
38 lines
1.2 KiB
C++
38 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "AbstractBean.hpp"
|
|
#include "V2RayStreamSettings.hpp"
|
|
#include "Preset.hpp"
|
|
|
|
namespace NekoGui_fmt {
|
|
class ShadowSocksBean : public AbstractBean {
|
|
public:
|
|
QString method = "aes-128-gcm";
|
|
QString password = "";
|
|
QString plugin = "";
|
|
int uot = 0;
|
|
|
|
std::shared_ptr<V2rayStreamSettings> stream = std::make_shared<V2rayStreamSettings>();
|
|
|
|
ShadowSocksBean() : AbstractBean(0) {
|
|
_add(new configItem("method", &method, itemType::string));
|
|
_add(new configItem("pass", &password, itemType::string));
|
|
_add(new configItem("plugin", &plugin, itemType::string));
|
|
_add(new configItem("uot", &uot, itemType::integer));
|
|
_add(new configItem("stream", dynamic_cast<JsonStore *>(stream.get()), itemType::jsonStore));
|
|
};
|
|
|
|
bool IsValid() {
|
|
return Preset::SingBox::ShadowsocksMethods.contains(method);
|
|
}
|
|
|
|
QString DisplayType() override { return "Shadowsocks"; };
|
|
|
|
CoreObjOutboundBuildResult BuildCoreObjSingBox() override;
|
|
|
|
bool TryParseLink(const QString &link);
|
|
|
|
QString ToShareLink() override;
|
|
};
|
|
} // namespace NekoGui_fmt
|