mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 05:30:06 +08:00
add new windows proxy format
This commit is contained in:
parent
f446c023d3
commit
64c5e5b7eb
16
3rdparty/qv2ray/v2/proxy/QvProxyConfigurator.cpp
vendored
16
3rdparty/qv2ray/v2/proxy/QvProxyConfigurator.cpp
vendored
@ -253,16 +253,14 @@ namespace Qv2ray::components::proxy {
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
if (scheme == "http") scheme = "http://";
|
||||
else if (scheme == "socks") scheme = "socks=";
|
||||
QString str = "{scheme}{ip}:{socks_port}";
|
||||
str = str.replace("{scheme}", scheme)
|
||||
.replace("{ip}", address)
|
||||
.replace("{socks_port}", Int2String(socksPort));
|
||||
if (scheme == "http") scheme = "http://{ip}:{port}";
|
||||
else if (scheme == "socks") scheme = "socks={ip}:{port}";
|
||||
scheme = scheme.replace("{ip}", address)
|
||||
.replace("{port}", Int2String(socksPort));
|
||||
//
|
||||
LOG("Windows proxy string: " + str);
|
||||
auto proxyStrW = new WCHAR[str.length() + 1];
|
||||
wcscpy(proxyStrW, str.toStdWString().c_str());
|
||||
LOG("Windows proxy string: " + scheme);
|
||||
auto proxyStrW = new WCHAR[scheme.length() + 1];
|
||||
wcscpy(proxyStrW, scheme.toStdWString().c_str());
|
||||
//
|
||||
__QueryProxyOptions();
|
||||
|
||||
|
||||
4
3rdparty/qv2ray/wrapper.hpp
vendored
4
3rdparty/qv2ray/wrapper.hpp
vendored
@ -5,8 +5,8 @@
|
||||
#include <QJsonDocument>
|
||||
#include <QDebug>
|
||||
|
||||
#define LOG(...) Qv2ray::base::log_internal(__VA_ARGS__)
|
||||
#define DEBUG(...) Qv2ray::base::log_internal(__VA_ARGS__)
|
||||
#define LOG(...) qDebug() << __VA_ARGS__
|
||||
#define DEBUG(...) qDebug() << __VA_ARGS__
|
||||
namespace Qv2ray {
|
||||
namespace base {
|
||||
template<typename... T>
|
||||
|
||||
@ -39,7 +39,7 @@ namespace NekoGui {
|
||||
bool need_keep_vpn_off = false;
|
||||
QString appdataDir = "";
|
||||
QStringList ignoreConnTag = {};
|
||||
QString proxy_scheme = "http";
|
||||
QString proxy_scheme = "{ip}:{port}";
|
||||
|
||||
std::unique_ptr<Routing> routing;
|
||||
int imported_count = 0;
|
||||
|
||||
@ -111,12 +111,17 @@
|
||||
<widget class="QComboBox" name="proxy_scheme">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>http</string>
|
||||
<string>{ip}:{port}</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>socks</string>
|
||||
<string>http://{ip}:{port}</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>socks={ip}:{port}</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user