CLashConfig.h 911 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #include "IBaseClash.h"
  3. #include <yaml-cpp/yaml.h>
  4. #include "CTool.h"
  5. #include "CProcess.h"
  6. #include "Logger.h"
  7. class CLashConfig : public IBaseClash
  8. {
  9. public:
  10. CLashConfig();
  11. ~CLashConfig(void);
  12. // ͨ¹ý IBaseClash ¼Ì³Ð
  13. virtual BOOL MakeClash() override;
  14. virtual BOOL InitClash() override;
  15. // ͨ¹ý IBaseClash ¼Ì³Ð
  16. virtual BOOL StartClash() override;
  17. virtual BOOL StopClash() override;
  18. private:
  19. YAML::Node buildShadowsocks();
  20. YAML::Node buildtrojan();
  21. YAML::Node buildv2ray();
  22. std::vector<YAML::Node> buildv2rayHost();
  23. YAML::Node builTunConfig();
  24. YAML::Node buildDnsConfig();
  25. std::vector<YAML::Node> buildProxyGroups();
  26. std::vector<YAML::Node> buildRules();
  27. private:
  28. void ThreadFun_process_Config(LPARAM lParam);
  29. private:
  30. int m_socks_port;
  31. int m_http_port;
  32. int m_c_port;
  33. bool m_is_qut;
  34. CProcess* m_process;
  35. AsynTaskHandle<LPARAM> m_Asyntask;
  36. Logger* m_log;
  37. };