mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
Fix TLS and ALPN
This commit is contained in:
@@ -208,7 +208,8 @@
|
||||
.ant-card-dark .ant-calendar-year-select,
|
||||
.ant-card-dark .ant-calendar-date,
|
||||
.ant-card-dark .ant-collapse>.ant-collapse-item>.ant-collapse-header,
|
||||
.ant-card-dark .ant-empty-normal {
|
||||
.ant-card-dark .ant-empty-normal,
|
||||
.ant-card-dark .ant-checkbox+span {
|
||||
color: hsla(0,0%,100%,.65);
|
||||
}
|
||||
|
||||
@@ -308,7 +309,8 @@
|
||||
border-color: #593815;
|
||||
}
|
||||
|
||||
.ant-card-dark .ant-table-row-expand-icon {
|
||||
.ant-card-dark .ant-table-row-expand-icon,
|
||||
.ant-card-dark .ant-checkbox-inner {
|
||||
background: none;
|
||||
}
|
||||
|
||||
@@ -316,12 +318,17 @@
|
||||
background-color: #0c61b0;
|
||||
}
|
||||
|
||||
.ant-card-dark .ant-btn {
|
||||
.ant-card-dark .ant-btn,
|
||||
.ant-card-dark .ant-radio-button-wrapper {
|
||||
color: hsla(0,0%,100%,.65);
|
||||
background: none;
|
||||
border: 1px solid hsla(0,0%,100%,.65);
|
||||
}
|
||||
|
||||
.ant-card-dark .ant-radio-button-wrapper:hover {
|
||||
color: #177ddc;
|
||||
}
|
||||
|
||||
.ant-card-dark .ant-btn-primary {
|
||||
color: hsla(0,0%,100%,.65);
|
||||
background-color: #073763;
|
||||
|
||||
@@ -95,7 +95,6 @@ const UTLS_FINGERPRINT = {
|
||||
const ALPN_OPTION = {
|
||||
H2: "h2",
|
||||
HTTP1: "http/1.1",
|
||||
BOTH: "h2,http/1.1",
|
||||
};
|
||||
|
||||
Object.freeze(Protocols);
|
||||
@@ -1092,7 +1091,6 @@ class Inbound extends XrayCommonClass {
|
||||
const type = this.stream.network;
|
||||
const params = new Map();
|
||||
params.set("type", this.stream.network);
|
||||
params.set("security", this.stream.security);
|
||||
switch (type) {
|
||||
case "tcp":
|
||||
const tcp = this.stream.tcp;
|
||||
@@ -1139,8 +1137,12 @@ class Inbound extends XrayCommonClass {
|
||||
}
|
||||
|
||||
if (this.tls) {
|
||||
params.set("security", "tls");
|
||||
params.set("fp" , this.stream.tls.settings[0]['fingerprint']);
|
||||
params.set("alpn", this.stream.tls.alpn[0]);
|
||||
params.set("alpn", this.stream.tls.alpn);
|
||||
if(this.stream.tls.settings[0].allowInsecure){
|
||||
params.set("allowInsecure", "1");
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(this.stream.tls.server)) {
|
||||
address = this.stream.tls.server;
|
||||
}
|
||||
@@ -1153,6 +1155,11 @@ class Inbound extends XrayCommonClass {
|
||||
}
|
||||
|
||||
if (this.xtls) {
|
||||
params.set("security", "tls");
|
||||
params.set("alpn", this.stream.tls.alpn);
|
||||
if(this.stream.tls.settings[0].allowInsecure){
|
||||
params.set("allowInsecure", "1");
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(this.stream.tls.server)) {
|
||||
address = this.stream.tls.server;
|
||||
}
|
||||
@@ -1188,7 +1195,6 @@ class Inbound extends XrayCommonClass {
|
||||
const type = this.stream.network;
|
||||
const params = new Map();
|
||||
params.set("type", this.stream.network);
|
||||
params.set("security", this.stream.security);
|
||||
switch (type) {
|
||||
case "tcp":
|
||||
const tcp = this.stream.tcp;
|
||||
@@ -1235,8 +1241,12 @@ class Inbound extends XrayCommonClass {
|
||||
}
|
||||
|
||||
if (this.tls) {
|
||||
params.set("security", "tls");
|
||||
params.set("fp" , this.stream.tls.settings[0]['fingerprint']);
|
||||
params.set("alpn", this.stream.tls.alpn[0]);
|
||||
params.set("alpn", this.stream.tls.alpn);
|
||||
if(this.stream.tls.settings[0].allowInsecure){
|
||||
params.set("allowInsecure", "1");
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(this.stream.tls.server)) {
|
||||
address = this.stream.tls.server;
|
||||
}
|
||||
@@ -1246,6 +1256,11 @@ class Inbound extends XrayCommonClass {
|
||||
}
|
||||
|
||||
if (this.xtls) {
|
||||
params.set("security", "tls");
|
||||
params.set("alpn", this.stream.tls.alpn);
|
||||
if(this.stream.tls.settings[0].allowInsecure){
|
||||
params.set("allowInsecure", "1");
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(this.stream.tls.server)) {
|
||||
address = this.stream.tls.server;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,11 @@
|
||||
<a-form-item label='{{ i18n "domainName" }}'>
|
||||
<a-input v-model.trim="inbound.stream.tls.server"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="Alpn">
|
||||
<a-checkbox-group v-model="inbound.stream.tls.alpn" style="width:200px">
|
||||
<a-checkbox v-for="key in ALPN_OPTION" :value="key">[[ key ]]</a-checkbox>
|
||||
</a-checkbox-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="Allow insecure">
|
||||
<a-switch v-model="inbound.stream.tls.settings[0].allowInsecure"></a-switch>
|
||||
</a-form-item>
|
||||
|
||||
Reference in New Issue
Block a user