You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+48-1Lines changed: 48 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ Compile script. It is recommended to always use this script to compile libXray.
40
40
41
41
depends on git and go.
42
42
43
-
By default, the build script does not clone [Xray-core](https://github.com/XTLS/Xray-core). It uses Go modules and pins Xray-core to release tag `v26.7.11` through its pseudo-version.
43
+
By default, the build script does not clone [Xray-core](https://github.com/XTLS/Xray-core). It uses Go modules and pins Xray-core to release tag `v26.7.28` through its pseudo-version.
44
44
Pass the optional `local` argument to use an existing local checkout at `../Xray-core` through a Go module `replace`.
45
45
46
46
### Usage
@@ -161,6 +161,14 @@ Design notes:
161
161
5.`convertShareLinksToXrayJson` validates each parsed outbound with the current
162
162
Xray-core config builder. Invalid outbounds are omitted, and the method fails
163
163
if none remain. Validation does not create or start an Xray instance.
164
+
6. Xray-core keeps its system dialer DNS client and outbound manager in
165
+
process-wide state. Creating another Xray instance through `ping`,
166
+
`pingBatch`, `testXray`, or the exported Go APIs while `runXray` or
167
+
`runXrayFromJson` is active may replace that state and affect the running
168
+
instance. Closing the temporary instance does not restore the previous
169
+
state. libXray does not serialize, isolate, or restore concurrent instances;
170
+
callers that require overlapping instances must place them in separate
171
+
processes.
164
172
165
173
Supported methods:
166
174
@@ -170,6 +178,7 @@ convertShareLinksToXrayJson
170
178
convertXrayJsonToShareLinks
171
179
countGeoData
172
180
ping
181
+
pingBatch
173
182
testXray
174
183
runXray
175
184
runXrayFromJson
@@ -282,6 +291,44 @@ Some tools used to parse shared links.
282
291
283
292
Latency testing.
284
293
294
+
### pingBatch
295
+
296
+
Tests multiple outbound configurations concurrently in one temporary Xray
297
+
instance. Each config file is parsed only for its `outbounds`; all other root
298
+
fields are ignored. The target outbound is selected by `outboundTag`, then by
299
+
the `proxy` tag, and finally by the first outbound.
300
+
301
+
```json
302
+
{
303
+
"apiVersion": 1,
304
+
"method": "pingBatch",
305
+
"payload": {
306
+
"configs": [
307
+
{
308
+
"configPath": "/path/to/node-1.json"
309
+
},
310
+
{
311
+
"configPath": "/path/to/full-config.json",
312
+
"outboundTag": "media"
313
+
}
314
+
],
315
+
"timeout": 5,
316
+
"url": "https://cp.cloudflare.com/"
317
+
}
318
+
}
319
+
```
320
+
321
+
Each request accepts at most five configurations and tests all accepted
322
+
configurations concurrently. Requests containing more than five configurations
323
+
fail before any configuration is tested.
324
+
325
+
The top-level response succeeds when the batch itself was accepted. Each item
326
+
has its own result; `delay` is `10000` for an error and `11000` for a timeout.
327
+
The result array has the same length and order as the input config array.
328
+
Outbound dependencies referenced by
329
+
`streamSettings.sockopt.dialerProxy` or `proxySettings.tag` are included
0 commit comments