mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-01 07:57:14 +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:
@@ -34,6 +34,7 @@ const props = defineProps({
|
||||
open: { type: Boolean, default: false },
|
||||
outbound: { type: Object, default: null },
|
||||
existingTags: { type: Array, default: () => [] },
|
||||
inboundTags: { type: Array, default: () => [] },
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:open', 'confirm']);
|
||||
@@ -199,6 +200,7 @@ const isBlackhole = computed(() => proto.value === Protocols.Blackhole);
|
||||
const isDNS = computed(() => proto.value === Protocols.DNS);
|
||||
const isWireguard = computed(() => proto.value === Protocols.Wireguard);
|
||||
const isHysteria = computed(() => proto.value === Protocols.Hysteria);
|
||||
const isLoopback = computed(() => proto.value === Protocols.Loopback);
|
||||
|
||||
function regenerateWgKeys() {
|
||||
if (!outbound.value?.settings) return;
|
||||
@@ -311,6 +313,16 @@ function regenerateWgKeys() {
|
||||
</a-form-item>
|
||||
</template>
|
||||
|
||||
<!-- ============== Loopback ============== -->
|
||||
<template v-if="isLoopback">
|
||||
<a-form-item label="Inbound tag">
|
||||
<a-auto-complete v-model:value="outbound.settings.inboundTag"
|
||||
:options="inboundTags.map((tag) => ({ value: tag }))"
|
||||
:filter-option="(input, option) => option.value.toLowerCase().includes(input.toLowerCase())"
|
||||
placeholder="tag of an existing inbound to re-route into" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
|
||||
<!-- ============== DNS ============== -->
|
||||
<template v-if="isDNS">
|
||||
<a-form-item :label="t('pages.inbounds.network')">
|
||||
|
||||
Reference in New Issue
Block a user