feat(xray): add the XDRIVE transport

xray-core v26.10.10 tunnels a stream through files in shared cloud
storage ("network": "xdrive"): Google Drive, a local folder, or any HTTP
storage API described by a template. The panel could not select it, and
the stream schema rejected a pasted xdrive stream outright.

The inbound and outbound forms now offer XDRIVE with one shared editor:
service, folder, the three Google Drive secrets in the order the core
reads them, a template JSON editor with its {secretN} values, the
optional domain front (the stream-level address/port the storage client
dials), and the core's tuning knobs with their defaults as placeholders.
Switching an inbound to XDRIVE resets security to none, because the
core would otherwise read the inbound's TLS/REALITY as the storage API's
client TLS.

XDRIVE has no share-link format, and a link carrying the storage
secrets would print them into every QR code, so both link generators
emit none for it; the JSON subscription already passes the stream
through intact, and Clash drops the unknown transport.
This commit is contained in:
MHSanaei
2026-10-11 08:21:08 +02:00
parent 73a028f52d
commit ca5983595b
34 changed files with 848 additions and 19 deletions
+22
View File
@@ -127,6 +127,28 @@ describe('genVlessLink', () => {
}
});
describe('XDRIVE share links', () => {
// No client reads an xdrive link, and one carrying the storage secrets would print
// them into every QR code; mirrors the Go generator, which emits none either.
it('emits no link for an XDRIVE stream', () => {
const [, raw] = fixturesForProtocol('vless').find(([name]) => name === 'vless-ws-tls')!;
const inbound = InboundSchema.parse({
...raw,
streamSettings: {
network: 'xdrive',
security: 'none',
xdriveSettings: { service: 'local', remoteFolder: '/srv/xdrive' },
},
});
const client = (raw as { settings: { clients: Array<{ id: string; email: string }> } }).settings
.clients[0];
const entries = genAllLinks({ inbound, client, fallbackHostname: 'panel.example.test' });
expect(entries.map((e) => e.link)).toEqual(['']);
});
});
describe('applyVlessRoute', () => {
const id = '11111111-2222-4333-8444-555555555555';
it('encodes a single value into the 3rd group and no-ops on invalid input', () => {