mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2026-04-07 02:53:20 +08:00
perf: Add support for sending http requests using specific nodes
Only supported on Loon & Surge
This commit is contained in:
11
backend/src/vendor/open-api.js
vendored
11
backend/src/vendor/open-api.js
vendored
@@ -253,6 +253,17 @@ export function HTTP(defaultOptions = { baseURL: '' }) {
|
||||
|
||||
events.onRequest(method, options);
|
||||
|
||||
if (options.node) {
|
||||
// Surge & Loon allow connecting to a server using a specified proxy node
|
||||
if (isSurge) {
|
||||
const build = $environment['surge-build'];
|
||||
if (build && parseInt(build) >= 2407) {
|
||||
options['policy-descriptor'] = options.node;
|
||||
delete options.node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let worker;
|
||||
if (isQX) {
|
||||
worker = $task.fetch({
|
||||
|
||||
Reference in New Issue
Block a user