mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-05-08 14:36:13 +00:00
new: vless reverse
legacy reverse removed
This commit is contained in:
@@ -129,12 +129,17 @@ type CustomGeoResource struct {
|
||||
UpdatedAt int64 `json:"updatedAt" gorm:"autoUpdateTime;column:updated_at"`
|
||||
}
|
||||
|
||||
type ClientReverse struct {
|
||||
Tag string `json:"tag"`
|
||||
}
|
||||
|
||||
// Client represents a client configuration for Xray inbounds with traffic limits and settings.
|
||||
type Client struct {
|
||||
ID string `json:"id,omitempty"` // Unique client identifier
|
||||
Security string `json:"security"` // Security method (e.g., "auto", "aes-128-gcm")
|
||||
Password string `json:"password,omitempty"` // Client password
|
||||
Flow string `json:"flow,omitempty"` // Flow control (XTLS)
|
||||
Reverse *ClientReverse `json:"reverse,omitempty"` // VLESS simple reverse proxy settings
|
||||
Auth string `json:"auth,omitempty"` // Auth password (Hysteria)
|
||||
Email string `json:"email"` // Client email identifier
|
||||
LimitIP int `json:"limitIp"` // IP limit for this client
|
||||
|
||||
@@ -2616,27 +2616,34 @@ Inbound.VLESSSettings.VLESS = class extends Inbound.ClientBase {
|
||||
constructor(
|
||||
id = RandomUtil.randomUUID(),
|
||||
flow = '',
|
||||
reverseTag = '',
|
||||
email, limitIp, totalGB, expiryTime, enable, tgId, subId, comment, reset, created_at, updated_at,
|
||||
) {
|
||||
super(email, limitIp, totalGB, expiryTime, enable, tgId, subId, comment, reset, created_at, updated_at);
|
||||
this.id = id;
|
||||
this.flow = flow;
|
||||
this.reverseTag = reverseTag;
|
||||
}
|
||||
|
||||
static fromJson(json = {}) {
|
||||
return new Inbound.VLESSSettings.VLESS(
|
||||
json.id,
|
||||
json.flow,
|
||||
json.reverse?.tag ?? '',
|
||||
...Inbound.ClientBase.commonArgsFromJson(json),
|
||||
);
|
||||
}
|
||||
|
||||
toJson() {
|
||||
return {
|
||||
const json = {
|
||||
id: this.id,
|
||||
flow: this.flow,
|
||||
...this._clientBaseToJson(),
|
||||
};
|
||||
if (this.reverseTag) {
|
||||
json.reverse = { tag: this.reverseTag };
|
||||
}
|
||||
return json;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1747,13 +1747,14 @@ Outbound.VmessSettings = class extends CommonClass {
|
||||
}
|
||||
};
|
||||
Outbound.VLESSSettings = class extends CommonClass {
|
||||
constructor(address, port, id, flow, encryption, testpre = 0, testseed = [900, 500, 900, 256]) {
|
||||
constructor(address, port, id, flow, encryption, reverseTag = '', testpre = 0, testseed = [900, 500, 900, 256]) {
|
||||
super();
|
||||
this.address = address;
|
||||
this.port = port;
|
||||
this.id = id;
|
||||
this.flow = flow;
|
||||
this.encryption = encryption;
|
||||
this.reverseTag = reverseTag;
|
||||
this.testpre = testpre;
|
||||
this.testseed = testseed;
|
||||
}
|
||||
@@ -1766,6 +1767,7 @@ Outbound.VLESSSettings = class extends CommonClass {
|
||||
json.id,
|
||||
json.flow,
|
||||
json.encryption,
|
||||
json.reverse?.tag || '',
|
||||
json.testpre || 0,
|
||||
json.testseed && json.testseed.length >= 4 ? json.testseed : [900, 500, 900, 256]
|
||||
);
|
||||
@@ -1779,6 +1781,9 @@ Outbound.VLESSSettings = class extends CommonClass {
|
||||
flow: this.flow,
|
||||
encryption: this.encryption,
|
||||
};
|
||||
if (!ObjectUtil.isEmpty(this.reverseTag)) {
|
||||
result.reverse = { tag: this.reverseTag };
|
||||
}
|
||||
// Only include Vision settings when flow is set
|
||||
if (this.flow && this.flow !== '') {
|
||||
if (this.testpre > 0) {
|
||||
|
||||
@@ -129,6 +129,18 @@
|
||||
<a-select-option v-for="key in TLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item v-if="inbound.protocol === Protocols.VLESS">
|
||||
<template slot="label">
|
||||
<a-tooltip>
|
||||
<template slot="title">
|
||||
<span>{{ i18n "pages.xray.outbound.reverseTagDesc" }}</span>
|
||||
</template>
|
||||
{{ i18n "pages.xray.outbound.reverseTag" }}
|
||||
<a-icon type="question-circle"></a-icon>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model.trim="client.reverseTag" :placeholder='`{{ i18n "pages.xray.outbound.reverseTagPlaceholder" }}`'></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<template slot="label">
|
||||
<a-tooltip>
|
||||
|
||||
@@ -342,6 +342,18 @@
|
||||
<a-form-item label="encryption">
|
||||
<a-input v-model.trim="outbound.settings.encryption"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<template slot="label">
|
||||
<a-tooltip>
|
||||
<template slot="title">
|
||||
<span>{{ i18n "pages.xray.outbound.reverseTagDesc" }}</span>
|
||||
</template>
|
||||
{{ i18n "pages.xray.outbound.reverseTag" }}
|
||||
<a-icon type="question-circle"></a-icon>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<a-input v-model.trim="outbound.settings.reverseTag" :placeholder='`{{ i18n "pages.xray.outbound.reverseTagPlaceholder" }}`'></a-input>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<template v-if="outbound.canEnableTlsFlow()">
|
||||
<a-form-item label="Flow">
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
{{define "modals/reverseModal"}}
|
||||
<a-modal id="reverse-modal" v-model="reverseModal.visible" :title="reverseModal.title" @ok="reverseModal.ok"
|
||||
:confirm-loading="reverseModal.confirmLoading" :closable="true" :mask-closable="false"
|
||||
:ok-text="reverseModal.okText" cancel-text='{{ i18n "close" }}' :class="themeSwitcher.currentTheme">
|
||||
<a-form :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }">
|
||||
<a-form-item label='{{ i18n "pages.xray.outbound.type" }}'>
|
||||
<a-select v-model="reverseModal.reverse.type" :dropdown-class-name="themeSwitcher.currentTheme">
|
||||
<a-select-option v-for="x,y in reverseTypes" :value="y">[[ x ]]</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label='{{ i18n "pages.xray.outbound.tag" }}'>
|
||||
<a-input v-model.trim="reverseModal.reverse.tag"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label='{{ i18n "pages.xray.outbound.domain" }}'>
|
||||
<a-input v-model.trim="reverseModal.reverse.domain"></a-input>
|
||||
</a-form-item>
|
||||
<template v-if="reverseModal.reverse.type=='bridge'">
|
||||
<a-form-item label='{{ i18n "pages.xray.outbound.intercon" }}'>
|
||||
<a-select v-model="reverseModal.rules[0].outboundTag" :dropdown-class-name="themeSwitcher.currentTheme">
|
||||
<a-select-option v-for="x in reverseModal.outboundTags" :value="x">[[ x ]]</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label='{{ i18n "pages.xray.rules.outbound" }}'>
|
||||
<a-select v-model="reverseModal.rules[1].outboundTag" :dropdown-class-name="themeSwitcher.currentTheme">
|
||||
<a-select-option v-for="x in reverseModal.outboundTags" :value="x">[[ x ]]</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-form-item label='{{ i18n "pages.xray.outbound.intercon" }}'>
|
||||
<a-checkbox-group v-model="reverseModal.rules[0].inboundTag"
|
||||
:options="reverseModal.inboundTags"></a-checkbox-group>
|
||||
</a-form-item>
|
||||
<a-form-item label='{{ i18n "pages.xray.rules.inbound" }}'>
|
||||
<a-checkbox-group v-model="reverseModal.rules[1].inboundTag"
|
||||
:options="reverseModal.inboundTags"></a-checkbox-group>
|
||||
</a-form-item>
|
||||
</template>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<script>
|
||||
const reverseModal = {
|
||||
title: '',
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
okText: '{{ i18n "sure" }}',
|
||||
isEdit: false,
|
||||
confirm: null,
|
||||
reverse: {
|
||||
tag: "",
|
||||
type: "",
|
||||
domain: ""
|
||||
},
|
||||
rules: [{
|
||||
outboundTag: '',
|
||||
inboundTag: []
|
||||
},
|
||||
{
|
||||
outboundTag: '',
|
||||
inboundTag: []
|
||||
}
|
||||
],
|
||||
inboundTags: [],
|
||||
outboundTags: [],
|
||||
ok() {
|
||||
reverseModal.rules[0].domain = ["full:" + reverseModal.reverse.domain];
|
||||
reverseModal.rules[0].type = 'field';
|
||||
reverseModal.rules[1].type = 'field';
|
||||
|
||||
if (reverseModal.reverse.type == 'bridge') {
|
||||
reverseModal.rules[0].inboundTag = [reverseModal.reverse.tag];
|
||||
reverseModal.rules[1].inboundTag = [reverseModal.reverse.tag];
|
||||
} else {
|
||||
reverseModal.rules[0].outboundTag = reverseModal.reverse.tag;
|
||||
reverseModal.rules[1].outboundTag = reverseModal.reverse.tag;
|
||||
}
|
||||
ObjectUtil.execute(reverseModal.confirm, reverseModal.reverse, reverseModal.rules);
|
||||
},
|
||||
show({
|
||||
title = '',
|
||||
okText = '{{ i18n "sure" }}',
|
||||
reverse,
|
||||
rules,
|
||||
confirm = (reverse, rules) => {},
|
||||
isEdit = false
|
||||
}) {
|
||||
this.title = title;
|
||||
this.okText = okText;
|
||||
this.confirm = confirm;
|
||||
this.visible = true;
|
||||
if (isEdit) {
|
||||
this.reverse = {
|
||||
tag: reverse.tag,
|
||||
type: reverse.type,
|
||||
domain: reverse.domain,
|
||||
};
|
||||
reverse;
|
||||
rules0 = rules.filter(r => r.domain != null);
|
||||
if (rules0.length == 0) rules0 = [{
|
||||
outboundTag: '',
|
||||
domain: ["full:" + this.reverse.domain],
|
||||
inboundTag: []
|
||||
}];
|
||||
rules1 = rules.filter(r => r.domain == null);
|
||||
if (rules1.length == 0) rules1 = [{
|
||||
outboundTag: '',
|
||||
inboundTag: []
|
||||
}];
|
||||
this.rules = [];
|
||||
this.rules.push({
|
||||
domain: rules0[0].domain,
|
||||
outboundTag: rules0[0].outboundTag,
|
||||
inboundTag: rules0.map(r => r.inboundTag).flat()
|
||||
});
|
||||
this.rules.push({
|
||||
outboundTag: rules1[0].outboundTag,
|
||||
inboundTag: rules1.map(r => r.inboundTag).flat()
|
||||
});
|
||||
} else {
|
||||
this.reverse = {
|
||||
tag: "reverse-" + app.reverseData.length,
|
||||
type: "bridge",
|
||||
domain: "reverse.xui"
|
||||
}
|
||||
this.rules = [{
|
||||
outboundTag: '',
|
||||
inboundTag: []
|
||||
},
|
||||
{
|
||||
outboundTag: '',
|
||||
inboundTag: []
|
||||
}
|
||||
]
|
||||
}
|
||||
this.isEdit = isEdit;
|
||||
this.inboundTags = app.templateSettings.inbounds.filter((i) => !ObjectUtil.isEmpty(i.tag)).map(obj =>
|
||||
obj.tag);
|
||||
this.inboundTags.push(...app.inboundTags);
|
||||
if (app.enableDNS && !ObjectUtil.isEmpty(app.dnsTag)) this.inboundTags.push(app.dnsTag)
|
||||
this.outboundTags = app.templateSettings.outbounds.filter((o) => !ObjectUtil.isEmpty(o.tag)).map(obj =>
|
||||
obj.tag);
|
||||
},
|
||||
close() {
|
||||
reverseModal.visible = false;
|
||||
reverseModal.loading(false);
|
||||
},
|
||||
loading(loading = true) {
|
||||
reverseModal.confirmLoading = loading;
|
||||
},
|
||||
};
|
||||
|
||||
new Vue({
|
||||
delimiters: ['[[', ']]'],
|
||||
el: '#reverse-modal',
|
||||
data: {
|
||||
reverseModal: reverseModal,
|
||||
reverseTypes: {
|
||||
bridge: '{{ i18n "pages.xray.outbound.bridge" }}',
|
||||
portal: '{{ i18n "pages.xray.outbound.portal" }}'
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
@@ -204,13 +204,6 @@
|
||||
if (app.enableDNS && !ObjectUtil.isEmpty(app.dnsTag)) this.inboundTags.push(app.dnsTag)
|
||||
this.outboundTags = ["", ...app.templateSettings.outbounds.filter((o) => !ObjectUtil.isEmpty(o.tag)).map(obj =>
|
||||
obj.tag)];
|
||||
if (app.templateSettings.reverse) {
|
||||
if (app.templateSettings.reverse.bridges) {
|
||||
this.inboundTags.push(...app.templateSettings.reverse.bridges.map(b => b.tag));
|
||||
}
|
||||
if (app.templateSettings.reverse.portals) this.outboundTags.push(...app.templateSettings.reverse.portals.map(
|
||||
b => b.tag));
|
||||
}
|
||||
this.balancerTags = [""];
|
||||
if (app.templateSettings.routing && app.templateSettings.routing.balancers) {
|
||||
this.balancerTags = ["", ...app.templateSettings.routing.balancers.filter((o) => !ObjectUtil.isEmpty(o.tag))
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
{{define "settings/xray/reverse"}}
|
||||
<template v-if="reverseData.length > 0">
|
||||
<a-space direction="vertical" size="middle">
|
||||
<a-button type="primary" icon="plus" @click="addReverse()">
|
||||
<span>{{ i18n "pages.xray.outbound.addReverse" }}</span>
|
||||
</a-button>
|
||||
<a-table :columns="reverseColumns" bordered :row-key="r => r.key" :data-source="reverseData"
|
||||
:scroll="isMobile ? {} : { x: 200 }" :pagination="false" :indent-size="0"
|
||||
:locale='{ filterConfirm: `{{ i18n "confirm" }}`, filterReset: `{{ i18n "reset" }}` }'>
|
||||
<template slot="action" slot-scope="text, reverse, index">
|
||||
<span>[[ index+1 ]]</span>
|
||||
<a-dropdown :trigger="['click']">
|
||||
<a-icon @click="e => e.preventDefault()" type="more"
|
||||
:style="{ fontSize: '16px', textDecoration: 'bold' }"></a-icon>
|
||||
<a-menu slot="overlay" :theme="themeSwitcher.currentTheme">
|
||||
<a-menu-item @click="editReverse(index)">
|
||||
<a-icon type="edit"></a-icon>
|
||||
<span>{{ i18n "edit" }}</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item @click="deleteReverse(index)">
|
||||
<span :style="{ color: '#FF4D4F' }">
|
||||
<a-icon type="delete"></a-icon>
|
||||
<span>{{ i18n "delete"}}</span>
|
||||
</span>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-space>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-empty description='{{ i18n "emptyReverseDesc" }}' :style="{ margin: '10px' }">
|
||||
<a-button type="primary" icon="plus" @click="addReverse()" :style="{ marginTop: '10px' }">
|
||||
{{ i18n "pages.xray.outbound.addReverse" }}
|
||||
</a-button>
|
||||
</a-empty>
|
||||
</template>
|
||||
{{end}}
|
||||
@@ -81,13 +81,6 @@
|
||||
</template>
|
||||
{{ template "settings/xray/outbounds" . }}
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="tpl-reverse" :style="{ paddingTop: '20px' }" force-render="true">
|
||||
<template #tab>
|
||||
<a-icon type="import"></a-icon>
|
||||
<span>{{ i18n "pages.xray.outbound.reverse"}}</span>
|
||||
</template>
|
||||
{{ template "settings/xray/reverse" . }}
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="tpl-balancer" :style="{ paddingTop: '20px' }" force-render="true">
|
||||
<template #tab>
|
||||
<a-icon type="cluster"></a-icon>
|
||||
@@ -135,7 +128,6 @@
|
||||
{{template "component/aSettingListItem" .}}
|
||||
{{template "modals/ruleModal" .}}
|
||||
{{template "modals/outModal" .}}
|
||||
{{template "modals/reverseModal" .}}
|
||||
{{template "modals/balancerModal" .}}
|
||||
{{template "modals/dnsModal" .}}
|
||||
{{template "modals/dnsPresetsModal" .}}
|
||||
@@ -184,34 +176,6 @@
|
||||
{ title: '{{ i18n "pages.xray.outbound.test" }}', align: 'center', width: 70, scopedSlots: { customRender: 'test' } },
|
||||
];
|
||||
|
||||
const reverseColumns = [{
|
||||
title: "#",
|
||||
align: 'center',
|
||||
width: 20,
|
||||
scopedSlots: {
|
||||
customRender: 'action'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '{{ i18n "pages.xray.outbound.type"}}',
|
||||
dataIndex: 'type',
|
||||
align: 'center',
|
||||
width: 50
|
||||
},
|
||||
{
|
||||
title: '{{ i18n "pages.xray.outbound.tag"}}',
|
||||
dataIndex: 'tag',
|
||||
align: 'center',
|
||||
width: 50
|
||||
},
|
||||
{
|
||||
title: '{{ i18n "pages.xray.outbound.domain"}}',
|
||||
dataIndex: 'domain',
|
||||
align: 'center',
|
||||
width: 50
|
||||
},
|
||||
];
|
||||
|
||||
const balancerColumns = [{
|
||||
title: "#",
|
||||
align: 'center',
|
||||
@@ -945,110 +909,6 @@
|
||||
Vue.prototype.$message.error('{{ i18n "pages.xray.outbound.testError" }}: ' + error.message);
|
||||
}
|
||||
},
|
||||
addReverse() {
|
||||
reverseModal.show({
|
||||
title: '{{ i18n "pages.xray.outbound.addReverse"}}',
|
||||
okText: '{{ i18n "pages.xray.outbound.addReverse" }}',
|
||||
confirm: (reverse, rules) => {
|
||||
reverseModal.loading();
|
||||
if (reverse.tag.length > 0) {
|
||||
newTemplateSettings = this.templateSettings;
|
||||
if (newTemplateSettings.reverse == undefined) newTemplateSettings.reverse = {};
|
||||
if (newTemplateSettings.reverse[reverse.type + 's'] == undefined) newTemplateSettings.reverse[
|
||||
reverse.type + 's'] = [];
|
||||
newTemplateSettings.reverse[reverse.type + 's'].push({
|
||||
tag: reverse.tag,
|
||||
domain: reverse.domain
|
||||
});
|
||||
this.templateSettings = newTemplateSettings;
|
||||
|
||||
// Add related rules
|
||||
this.templateSettings.routing.rules.push(...rules);
|
||||
this.routingRuleSettings = JSON.stringify(this.templateSettings.routing.rules);
|
||||
}
|
||||
reverseModal.close();
|
||||
},
|
||||
isEdit: false
|
||||
});
|
||||
},
|
||||
editReverse(index) {
|
||||
if (this.reverseData[index].type == "bridge") {
|
||||
oldRules = this.templateSettings.routing.rules.filter(r => r.inboundTag && r.inboundTag[0] == this
|
||||
.reverseData[index].tag);
|
||||
} else {
|
||||
oldRules = this.templateSettings.routing.rules.filter(r => r.outboundTag && r.outboundTag == this
|
||||
.reverseData[index].tag);
|
||||
}
|
||||
reverseModal.show({
|
||||
title: '{{ i18n "pages.xray.outbound.editReverse"}} ' + (index + 1),
|
||||
reverse: this.reverseData[index],
|
||||
rules: oldRules,
|
||||
confirm: (reverse, rules) => {
|
||||
reverseModal.loading();
|
||||
if (reverse.tag.length > 0) {
|
||||
oldData = this.reverseData[index];
|
||||
newTemplateSettings = this.templateSettings;
|
||||
oldReverseIndex = newTemplateSettings.reverse[oldData.type + 's'].findIndex(rs => rs.tag ==
|
||||
oldData.tag);
|
||||
oldRuleIndex0 = oldRules.length > 0 ? newTemplateSettings.routing.rules.findIndex(r => JSON
|
||||
.stringify(r) == JSON.stringify(oldRules[0])) : -1;
|
||||
oldRuleIndex1 = oldRules.length == 2 ? newTemplateSettings.routing.rules.findIndex(r => JSON
|
||||
.stringify(r) == JSON.stringify(oldRules[1])) : -1;
|
||||
if (oldData.type == reverse.type) {
|
||||
newTemplateSettings.reverse[oldData.type + 's'][oldReverseIndex] = {
|
||||
tag: reverse.tag,
|
||||
domain: reverse.domain
|
||||
};
|
||||
} else {
|
||||
newTemplateSettings.reverse[oldData.type + 's'].splice(oldReverseIndex, 1);
|
||||
// delete empty object
|
||||
if (newTemplateSettings.reverse[oldData.type + 's'].length == 0) Reflect.deleteProperty(
|
||||
newTemplateSettings.reverse, oldData.type + 's');
|
||||
// add other type of reverse if it is not exist
|
||||
if (!newTemplateSettings.reverse[reverse.type + 's']) newTemplateSettings.reverse[reverse
|
||||
.type + 's'] = [];
|
||||
newTemplateSettings.reverse[reverse.type + 's'].push({
|
||||
tag: reverse.tag,
|
||||
domain: reverse.domain
|
||||
});
|
||||
}
|
||||
this.templateSettings = newTemplateSettings;
|
||||
|
||||
// Adjust Rules
|
||||
newRules = this.templateSettings.routing.rules;
|
||||
oldRuleIndex0 != -1 ? newRules[oldRuleIndex0] = rules[0] : newRules.push(rules[0]);
|
||||
oldRuleIndex1 != -1 ? newRules[oldRuleIndex1] = rules[1] : newRules.push(rules[1]);
|
||||
this.routingRuleSettings = JSON.stringify(newRules);
|
||||
}
|
||||
reverseModal.close();
|
||||
},
|
||||
isEdit: true
|
||||
});
|
||||
},
|
||||
deleteReverse(index) {
|
||||
oldData = this.reverseData[index];
|
||||
newTemplateSettings = this.templateSettings;
|
||||
reverseTypeObj = newTemplateSettings.reverse[oldData.type + 's'];
|
||||
realIndex = reverseTypeObj.findIndex(r => r.tag == oldData.tag && r.domain == oldData.domain);
|
||||
newTemplateSettings.reverse[oldData.type + 's'].splice(realIndex, 1);
|
||||
|
||||
// delete empty objects
|
||||
if (reverseTypeObj.length == 0) Reflect.deleteProperty(newTemplateSettings.reverse, oldData.type + 's');
|
||||
if (Object.keys(newTemplateSettings.reverse).length === 0) Reflect.deleteProperty(newTemplateSettings,
|
||||
'reverse');
|
||||
|
||||
// delete related routing rules
|
||||
newRules = newTemplateSettings.routing.rules;
|
||||
if (oldData.type == "bridge") {
|
||||
newRules = newTemplateSettings.routing.rules.filter(r => !(r.inboundTag && r.inboundTag.length == 1 && r
|
||||
.inboundTag[0] == oldData.tag));
|
||||
} else if (oldData.type == "portal") {
|
||||
newRules = newTemplateSettings.routing.rules.filter(r => r.outboundTag != oldData.tag);
|
||||
}
|
||||
newTemplateSettings.routing.rules = newRules;
|
||||
|
||||
this.templateSettings = newTemplateSettings;
|
||||
},
|
||||
async refreshOutboundTraffic() {
|
||||
if (!this.refreshing) {
|
||||
this.refreshing = true;
|
||||
@@ -1457,32 +1317,6 @@
|
||||
return data;
|
||||
},
|
||||
},
|
||||
reverseData: {
|
||||
get: function() {
|
||||
data = []
|
||||
if (this.templateSettings != null && this.templateSettings.reverse != null) {
|
||||
if (this.templateSettings.reverse.bridges) {
|
||||
this.templateSettings.reverse.bridges.forEach((o, index) => {
|
||||
data.push({
|
||||
'key': index,
|
||||
'type': 'bridge',
|
||||
...o
|
||||
});
|
||||
});
|
||||
}
|
||||
if (this.templateSettings.reverse.portals) {
|
||||
this.templateSettings.reverse.portals.forEach((o, index) => {
|
||||
data.push({
|
||||
'key': index,
|
||||
'type': 'portal',
|
||||
...o
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
return data;
|
||||
},
|
||||
},
|
||||
routingRuleSettings: {
|
||||
get: function() {
|
||||
return this.templateSettings ? JSON.stringify(this.templateSettings.routing.rules, null, 2) : null;
|
||||
|
||||
@@ -148,7 +148,7 @@ func (s *XrayService) GetXrayConfig() (*xray.Config, error) {
|
||||
|
||||
// clear client config for additional parameters
|
||||
for key := range c {
|
||||
if key != "email" && key != "id" && key != "password" && key != "flow" && key != "method" && key != "auth" {
|
||||
if key != "email" && key != "id" && key != "password" && key != "flow" && key != "method" && key != "auth" && key != "reverse" {
|
||||
delete(c, key)
|
||||
}
|
||||
if flow, ok := c["flow"].(string); ok && flow == "xtls-rprx-vision-udp443" {
|
||||
|
||||
@@ -584,6 +584,9 @@
|
||||
"addReverse" = "أضف عكسي"
|
||||
"editOutbound" = "عدل المخرج"
|
||||
"editReverse" = "عدل العكسي"
|
||||
"reverseTag" = "وسم العكسي"
|
||||
"reverseTagDesc" = "وسم الخروج لبروكسي VLESS العكسي البسيط. اتركه فارغاً لتعطيله."
|
||||
"reverseTagPlaceholder" = "وسم الخروج (اتركه فارغاً للتعطيل)"
|
||||
"tag" = "تاج"
|
||||
"tagDesc" = "تاج فريد"
|
||||
"address" = "العنوان"
|
||||
|
||||
@@ -584,6 +584,9 @@
|
||||
"addReverse" = "Add Reverse"
|
||||
"editOutbound" = "Edit Outbound"
|
||||
"editReverse" = "Edit Reverse"
|
||||
"reverseTag" = "Reverse Tag"
|
||||
"reverseTagDesc" = "VLESS simple reverse proxy tag. Leave empty to disable."
|
||||
"reverseTagPlaceholder" = "reverse tag (leave empty to disable)"
|
||||
"tag" = "Tag"
|
||||
"tagDesc" = "Unique Tag"
|
||||
"address" = "Address"
|
||||
|
||||
@@ -584,6 +584,9 @@
|
||||
"addReverse" = "Agregar reverso"
|
||||
"editOutbound" = "Editar salida"
|
||||
"editReverse" = "Editar reverso"
|
||||
"reverseTag" = "Etiqueta Reverso"
|
||||
"reverseTagDesc" = "Etiqueta de salida del proxy inverso simple VLESS. Dejar vacío para deshabilitar. Cuando se establece, las conexiones de este cliente pueden usarse como túnel de proxy inverso."
|
||||
"reverseTagPlaceholder" = "etiqueta de salida (vacío para deshabilitar)"
|
||||
"tag" = "Etiqueta"
|
||||
"tagDesc" = "etiqueta única"
|
||||
"address" = "Dirección"
|
||||
|
||||
@@ -584,6 +584,9 @@
|
||||
"addReverse" = "افزودن معکوس"
|
||||
"editOutbound" = "ویرایش خروجی"
|
||||
"editReverse" = "ویرایش معکوس"
|
||||
"reverseTag" = "تگ معکوس"
|
||||
"reverseTagDesc" = "تگ خروجی پروکسی معکوس ساده VLESS. برای غیرفعال کردن خالی بگذارید. در صورت تنظیم، اتصالات این کلاینت میتوانند به عنوان تونل پروکسی معکوس استفاده شوند."
|
||||
"reverseTagPlaceholder" = "تگ خروجی (خالی = غیرفعال)"
|
||||
"tag" = "برچسب"
|
||||
"tagDesc" = "برچسب یگانه"
|
||||
"address" = "آدرس"
|
||||
|
||||
@@ -584,6 +584,9 @@
|
||||
"addReverse" = "Tambahkan Revers"
|
||||
"editOutbound" = "Edit Keluar"
|
||||
"editReverse" = "Edit Revers"
|
||||
"reverseTag" = "Tag Revers"
|
||||
"reverseTagDesc" = "Tag outbound proxy revers sederhana VLESS. Kosongkan untuk menonaktifkan."
|
||||
"reverseTagPlaceholder" = "tag outbound (kosong untuk menonaktifkan)"
|
||||
"tag" = "Tag"
|
||||
"tagDesc" = "Tag Unik"
|
||||
"address" = "Alamat"
|
||||
|
||||
@@ -584,6 +584,9 @@
|
||||
"addReverse" = "リバース追加"
|
||||
"editOutbound" = "アウトバウンド編集"
|
||||
"editReverse" = "リバース編集"
|
||||
"reverseTag" = "リバースタグ"
|
||||
"reverseTagDesc" = "VLESSシンプルリバースプロキシのアウトバウンドタグ。無効にするには空欄にしてください。"
|
||||
"reverseTagPlaceholder" = "アウトバウンドタグ(空欄で無効)"
|
||||
"tag" = "タグ"
|
||||
"tagDesc" = "一意のタグ"
|
||||
"address" = "アドレス"
|
||||
|
||||
@@ -584,6 +584,9 @@
|
||||
"addReverse" = "Adicionar Reverso"
|
||||
"editOutbound" = "Editar Saída"
|
||||
"editReverse" = "Editar Reverso"
|
||||
"reverseTag" = "Tag de Reverso"
|
||||
"reverseTagDesc" = "Tag de saída do proxy reverso simples VLESS. Deixe vazio para desabilitar."
|
||||
"reverseTagPlaceholder" = "tag de saída (vazio para desabilitar)"
|
||||
"tag" = "Tag"
|
||||
"tagDesc" = "Tag Única"
|
||||
"address" = "Endereço"
|
||||
|
||||
@@ -584,6 +584,9 @@
|
||||
"addReverse" = "Создать реверс-прокси"
|
||||
"editOutbound" = "Изменить исходящее подключение"
|
||||
"editReverse" = "Редактировать реверс-прокси"
|
||||
"reverseTag" = "Тег реверс-прокси"
|
||||
"reverseTagDesc" = "Тег исходящего подключения для простого реверс-прокси VLESS. Оставьте пустым для отключения."
|
||||
"reverseTagPlaceholder" = "тег исходящего (пусто = отключено)"
|
||||
"tag" = "Тег"
|
||||
"tagDesc" = "Уникальный тег"
|
||||
"address" = "Адрес"
|
||||
|
||||
@@ -584,6 +584,9 @@
|
||||
"addReverse" = "Ters Ekle"
|
||||
"editOutbound" = "Gideni Düzenle"
|
||||
"editReverse" = "Tersi Düzenle"
|
||||
"reverseTag" = "Ters Etiket"
|
||||
"reverseTagDesc" = "VLESS basit ters proxy çıkış etiketi. Devre dışı bırakmak için boş bırakın."
|
||||
"reverseTagPlaceholder" = "çıkış etiketi (boş = devre dışı)"
|
||||
"tag" = "Etiket"
|
||||
"tagDesc" = "Benzersiz Etiket"
|
||||
"address" = "Adres"
|
||||
|
||||
@@ -584,6 +584,9 @@
|
||||
"addReverse" = "Додати реверс"
|
||||
"editOutbound" = "Редагувати вихідні"
|
||||
"editReverse" = "Редагувати реверс"
|
||||
"reverseTag" = "Тег реверс-проксі"
|
||||
"reverseTagDesc" = "Тег вихідного з'єднання для простого реверс-проксі VLESS. Залиште порожнім для вимкнення."
|
||||
"reverseTagPlaceholder" = "тег вихідного (порожнє = вимкнено)"
|
||||
"tag" = "Тег"
|
||||
"tagDesc" = "Унікальний тег"
|
||||
"address" = "Адреса"
|
||||
|
||||
@@ -584,6 +584,9 @@
|
||||
"addReverse" = "Thêm đảo ngược"
|
||||
"editOutbound" = "Chỉnh sửa gửi đi"
|
||||
"editReverse" = "Chỉnh sửa ngược lại"
|
||||
"reverseTag" = "Thẻ Ngược"
|
||||
"reverseTagDesc" = "Thẻ outbound của proxy ngược đơn giản VLESS. Để trống để vô hiệu hóa."
|
||||
"reverseTagPlaceholder" = "thẻ outbound (để trống để vô hiệu hóa)"
|
||||
"tag" = "Thẻ"
|
||||
"tagDesc" = "thẻ duy nhất"
|
||||
"address" = "Địa chỉ"
|
||||
|
||||
@@ -584,6 +584,9 @@
|
||||
"addReverse" = "添加反向"
|
||||
"editOutbound" = "编辑出站"
|
||||
"editReverse" = "编辑反向"
|
||||
"reverseTag" = "反向标签"
|
||||
"reverseTagDesc" = "VLESS 简易反向代理出站标签。留空则禁用。设置后,此客户端的连接可用作反向代理隧道。"
|
||||
"reverseTagPlaceholder" = "出站标签(留空则禁用)"
|
||||
"tag" = "标签"
|
||||
"tagDesc" = "唯一标签"
|
||||
"address" = "地址"
|
||||
|
||||
@@ -584,6 +584,9 @@
|
||||
"addReverse" = "新增反向"
|
||||
"editOutbound" = "編輯出站"
|
||||
"editReverse" = "編輯反向"
|
||||
"reverseTag" = "反向標籤"
|
||||
"reverseTagDesc" = "VLESS 簡易反向代理出站標籤。留空則停用。設定後,此客戶端的連線可作為反向代理隧道。"
|
||||
"reverseTagPlaceholder" = "出站標籤(留空則停用)"
|
||||
"tag" = "標籤"
|
||||
"tagDesc" = "唯一標籤"
|
||||
"address" = "地址"
|
||||
|
||||
Reference in New Issue
Block a user