Compare commits

...

7 Commits

Author SHA1 Message Date
asdlokj1qpi233
36229fc2ad fix compile error 2025-07-29 11:28:01 +08:00
asdlokj1qpi233
aa721c5b06 fix compile error 2025-07-29 11:25:32 +08:00
asdlokj1qpi233
60d20e42c8 fix bug(#37),(#39),(#42) 2025-07-29 11:21:19 +08:00
asdlokj1qpi233
645361a07e fix compile error 2025-07-29 11:03:32 +08:00
asdlokj1qpi23
9947eebbfc Merge pull request #47 from gengjiawen/patch-1
support surge hy2 port-hopping
2025-07-29 10:22:55 +08:00
Jiawen Geng
11bc5c7236 Update subexport.cpp 2025-07-25 01:38:00 -07:00
Jiawen Geng
4b4d227603 support surge hy2 port-hopping 2025-07-25 01:36:12 -07:00
7 changed files with 36 additions and 8 deletions

View File

@@ -8,8 +8,10 @@ WORKDIR /
RUN set -xe && \
apk add --no-cache --virtual .build-tools git g++ build-base linux-headers cmake python3 && \
apk add --no-cache --virtual .build-deps curl-dev rapidjson-dev pcre2-dev yaml-cpp-dev && \
git clone https://github.com/ftk/quickjspp --depth=1 && \
git clone --no-checkout https://github.com/ftk/quickjspp.git && \
cd quickjspp && \
git fetch origin 0c00c48895919fc02da3f191a2da06addeb07f09 && \
git checkout 0c00c48895919fc02da3f191a2da06addeb07f09 && \
git submodule update --init && \
cmake -DCMAKE_BUILD_TYPE=Release . && \
make quickjs -j $THREADS && \

View File

@@ -16,8 +16,10 @@ cmake -DCMAKE_BUILD_TYPE=Release -DYAML_CPP_BUILD_TESTS=OFF -DYAML_CPP_BUILD_TOO
make install -j3 > /dev/null
cd ..
git clone https://github.com/ftk/quickjspp --depth=1
git clone --no-checkout https://github.com/ftk/quickjspp.git
cd quickjspp
git fetch origin 0c00c48895919fc02da3f191a2da06addeb07f09
git checkout 0c00c48895919fc02da3f191a2da06addeb07f09
cmake -DCMAKE_BUILD_TYPE=Release .
make quickjs -j3 > /dev/null
install -d /usr/lib/quickjs/

View File

@@ -18,8 +18,10 @@ make -j6 > /dev/null
sudo make install > /dev/null
cd ..
git clone https://github.com/ftk/quickjspp --depth=1
git clone --no-checkout https://github.com/ftk/quickjspp.git
cd quickjspp
git fetch origin 0c00c48895919fc02da3f191a2da06addeb07f09
git checkout 0c00c48895919fc02da3f191a2da06addeb07f09
cmake -DCMAKE_BUILD_TYPE=Release .
make quickjs -j6 > /dev/null
sudo install -d /usr/local/lib/quickjs/

View File

@@ -13,8 +13,10 @@ cmake -DCMAKE_BUILD_TYPE=Release -DYAML_CPP_BUILD_TESTS=OFF -DYAML_CPP_BUILD_TOO
make install -j4
cd ..
git clone https://github.com/ftk/quickjspp --depth=1
git clone --no-checkout https://github.com/ftk/quickjspp.git
cd quickjspp
git fetch origin 0c00c48895919fc02da3f191a2da06addeb07f09
git checkout 0c00c48895919fc02da3f191a2da06addeb07f09
patch quickjs/quickjs-libc.c -i ../scripts/patches/0001-quickjs-libc-add-realpath-for-Windows.patch
cmake -G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Release \

View File

@@ -16,8 +16,10 @@ cd rapidjson
cp -r include/* $PREFIX/include/
cd ..
git clone https://github.com/ftk/quickjspp --depth=1
git clone --no-checkout https://github.com/ftk/quickjspp.git
cd quickjspp
git fetch origin 0c00c48895919fc02da3f191a2da06addeb07f09
git checkout 0c00c48895919fc02da3f191a2da06addeb07f09
cmake -DCMAKE_BUILD_TYPE=Release .
make quickjs -j3
install -d $PREFIX/lib/quickjs/

View File

@@ -1088,6 +1088,8 @@ std::string proxyToSurge(std::vector<Proxy> &nodes, const std::string &base_conf
proxy += ",server-cert-fingerprint-sha256=" + x.Fingerprint;
if (!x.ServerName.empty())
proxy += ",sni=" + x.ServerName;
if (!x.Ports.empty())
proxy += ",port-hopping=" + x.Ports;
break;
case ProxyType::WireGuard:
if (surge_ver < 4 && surge_ver != -3)
@@ -1296,8 +1298,13 @@ std::string proxyToSingle(std::vector<Proxy> &nodes, int types, extra_settings &
? "00000000-0000-0000-0000-000000000000"
: id) + "@" + hostname + ":" + port+"?";
if (!tls.empty()) {
proxyStr += "&security=" + tls;
if (!pbk.empty()) {
proxyStr += "&security=reality";
}else {
proxyStr += "&security=" + tls;
}
}
if (!flow.empty()) {
proxyStr += "&flow=" + flow;
}
@@ -2858,7 +2865,7 @@ proxyToSingBox(std::vector<Proxy> &nodes, rapidjson::Document &json,
rapidjson::Value utls(rapidjson::kObjectType);
utls.AddMember("enabled", true, allocator);
utls.AddMember("fingerprint", rapidjson::StringRef(x.Fingerprint.c_str()), allocator);
proxy.AddMember("utls", utls, allocator);
tls.AddMember("utls", utls, allocator);
}
proxy.AddMember("tls", tls, allocator);
break;

View File

@@ -37,14 +37,25 @@ std::map<std::string, std::string> parsedMD5;
std::string modSSMD5 = "f7653207090ce3389115e9c88541afe0";
//remake from speedtestutil
std::string removeBrackets(const std::string& input) {
std::string result = input;
size_t left = result.find('[');
size_t right = result.find(']');
if (left != std::string::npos && right != std::string::npos && right > left) {
result.erase(right, 1); // 删除 ']'
result.erase(left, 1); // 删除 '['
}
return result;
}
void commonConstruct(Proxy &node, ProxyType type, const std::string &group, const std::string &remarks,
const std::string &server, const std::string &port, const tribool &udp, const tribool &tfo,
const tribool &scv, const tribool &tls13, const std::string &underlying_proxy) {
node.Type = type;
node.Group = group;
node.Remark = remarks;
node.Hostname = server;
node.Hostname = removeBrackets(server);
node.Port = to_int(port);
node.UDP = udp;
node.TCPFastOpen = tfo;