mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-20 22:40:13 +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
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
if (scheme == "http") scheme = "http://";
|
if (scheme == "http") scheme = "http://{ip}:{port}";
|
||||||
else if (scheme == "socks") scheme = "socks=";
|
else if (scheme == "socks") scheme = "socks={ip}:{port}";
|
||||||
QString str = "{scheme}{ip}:{socks_port}";
|
scheme = scheme.replace("{ip}", address)
|
||||||
str = str.replace("{scheme}", scheme)
|
.replace("{port}", Int2String(socksPort));
|
||||||
.replace("{ip}", address)
|
|
||||||
.replace("{socks_port}", Int2String(socksPort));
|
|
||||||
//
|
//
|
||||||
LOG("Windows proxy string: " + str);
|
LOG("Windows proxy string: " + scheme);
|
||||||
auto proxyStrW = new WCHAR[str.length() + 1];
|
auto proxyStrW = new WCHAR[scheme.length() + 1];
|
||||||
wcscpy(proxyStrW, str.toStdWString().c_str());
|
wcscpy(proxyStrW, scheme.toStdWString().c_str());
|
||||||
//
|
//
|
||||||
__QueryProxyOptions();
|
__QueryProxyOptions();
|
||||||
|
|
||||||
|
|||||||
4
3rdparty/qv2ray/wrapper.hpp
vendored
4
3rdparty/qv2ray/wrapper.hpp
vendored
@ -5,8 +5,8 @@
|
|||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#define LOG(...) Qv2ray::base::log_internal(__VA_ARGS__)
|
#define LOG(...) qDebug() << __VA_ARGS__
|
||||||
#define DEBUG(...) Qv2ray::base::log_internal(__VA_ARGS__)
|
#define DEBUG(...) qDebug() << __VA_ARGS__
|
||||||
namespace Qv2ray {
|
namespace Qv2ray {
|
||||||
namespace base {
|
namespace base {
|
||||||
template<typename... T>
|
template<typename... T>
|
||||||
|
|||||||
@ -39,7 +39,7 @@ namespace NekoGui {
|
|||||||
bool need_keep_vpn_off = false;
|
bool need_keep_vpn_off = false;
|
||||||
QString appdataDir = "";
|
QString appdataDir = "";
|
||||||
QStringList ignoreConnTag = {};
|
QStringList ignoreConnTag = {};
|
||||||
QString proxy_scheme = "http";
|
QString proxy_scheme = "{ip}:{port}";
|
||||||
|
|
||||||
std::unique_ptr<Routing> routing;
|
std::unique_ptr<Routing> routing;
|
||||||
int imported_count = 0;
|
int imported_count = 0;
|
||||||
|
|||||||
@ -111,12 +111,17 @@
|
|||||||
<widget class="QComboBox" name="proxy_scheme">
|
<widget class="QComboBox" name="proxy_scheme">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>http</string>
|
<string>{ip}:{port}</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>socks</string>
|
<string>http://{ip}:{port}</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>socks={ip}:{port}</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user