mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-16 01:26:07 +00:00
feat(xray): add loopback outbound protocol
#4185 Surface xray-core's loopback outbound in the Outbounds form so users can re-route already-processed traffic back into a named inbound for secondary routing (e.g. splitting TCP/UDP from one ingress). The inboundTag field is an autocomplete over existing inbound tags, with free-text fallback for inbounds defined outside the panel. Loopback outbounds are excluded from the connectivity test since they have no network endpoint.
This commit is contained in:
@@ -12,6 +12,7 @@ export const Protocols = {
|
||||
Hysteria: "hysteria",
|
||||
Socks: "socks",
|
||||
HTTP: "http",
|
||||
Loopback: "loopback",
|
||||
};
|
||||
|
||||
export const SSMethods = {
|
||||
@@ -1586,6 +1587,7 @@ Outbound.Settings = class extends CommonClass {
|
||||
case Protocols.HTTP: return new Outbound.HttpSettings();
|
||||
case Protocols.Wireguard: return new Outbound.WireguardSettings();
|
||||
case Protocols.Hysteria: return new Outbound.HysteriaSettings();
|
||||
case Protocols.Loopback: return new Outbound.LoopbackSettings();
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
@@ -1603,6 +1605,7 @@ Outbound.Settings = class extends CommonClass {
|
||||
case Protocols.HTTP: return Outbound.HttpSettings.fromJson(json);
|
||||
case Protocols.Wireguard: return Outbound.WireguardSettings.fromJson(json);
|
||||
case Protocols.Hysteria: return Outbound.HysteriaSettings.fromJson(json);
|
||||
case Protocols.Loopback: return Outbound.LoopbackSettings.fromJson(json);
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
@@ -1782,6 +1785,23 @@ Outbound.BlackholeSettings = class extends CommonClass {
|
||||
}
|
||||
};
|
||||
|
||||
Outbound.LoopbackSettings = class extends CommonClass {
|
||||
constructor(inboundTag = '') {
|
||||
super();
|
||||
this.inboundTag = inboundTag;
|
||||
}
|
||||
|
||||
static fromJson(json = {}) {
|
||||
return new Outbound.LoopbackSettings(json.inboundTag || '');
|
||||
}
|
||||
|
||||
toJson() {
|
||||
return {
|
||||
inboundTag: this.inboundTag || undefined,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Outbound.DNSRule = class extends CommonClass {
|
||||
constructor(action = 'direct', qtype = '', domain = '') {
|
||||
super();
|
||||
|
||||
Reference in New Issue
Block a user