mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-18 04:54:38 +03:00
upload code
This commit is contained in:
39
fmt/SocksHttpBean.hpp
Normal file
39
fmt/SocksHttpBean.hpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
#include "fmt/AbstractBean.hpp"
|
||||
#include "fmt/V2RayStreamSettings.hpp"
|
||||
|
||||
namespace NekoRay::fmt {
|
||||
class SocksHttpBean : public AbstractBean {
|
||||
public:
|
||||
static constexpr int type_HTTP = -80;
|
||||
static constexpr int type_Socks4 = 4;
|
||||
static constexpr int type_Socks5 = 5;
|
||||
|
||||
int socks_http_type = type_Socks5;
|
||||
QString username = "";
|
||||
QString password = "";
|
||||
|
||||
QSharedPointer<V2rayStreamSettings> stream = QSharedPointer<V2rayStreamSettings>(new V2rayStreamSettings());
|
||||
QString custom = "";
|
||||
|
||||
explicit SocksHttpBean(int _socks_http_type) : AbstractBean(0) {
|
||||
this->socks_http_type = _socks_http_type;
|
||||
_add(new configItem("v", &socks_http_type, itemType::integer));
|
||||
_add(new configItem("username", &username, itemType::string));
|
||||
_add(new configItem("password", &password, itemType::string));
|
||||
_add(new configItem("stream", dynamic_cast<JsonStore *>(stream.get()), itemType::jsonStore));
|
||||
_add(new configItem("custom", &custom, itemType::string));
|
||||
};
|
||||
|
||||
QString DisplayType() override { return socks_http_type == type_HTTP ? "HTTP" : "Socks"; };
|
||||
|
||||
CoreObjOutboundBuildResult BuildCoreObj() override;
|
||||
|
||||
bool TryParseLink(const QString &link);
|
||||
|
||||
QString ToShareLink() override;
|
||||
|
||||
QString InsecureHint() override;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user