From 26a0481d8275c6d7953aaeb72a316db69c150354 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Mon, 10 Apr 2023 14:33:50 +0330 Subject: [PATCH] http header bug fixed --- database/db.go | 2 +- database/model/model.go | 6 ++--- go.mod | 2 +- web/assets/js/model/xray.js | 7 ++---- web/html/xui/form/protocol/trojan.html | 2 +- web/html/xui/form/protocol/vless.html | 28 ++++++++++++------------ web/html/xui/form/stream/stream_tcp.html | 2 +- web/html/xui/inbounds.html | 6 ++--- 8 files changed, 26 insertions(+), 29 deletions(-) diff --git a/database/db.go b/database/db.go index f7a590b231..b9c16be826 100644 --- a/database/db.go +++ b/database/db.go @@ -92,7 +92,7 @@ func InitDB(dbPath string) error { if err != nil { return err } - + return nil } diff --git a/database/model/model.go b/database/model/model.go index 6972421300..778ad9b6f2 100644 --- a/database/model/model.go +++ b/database/model/model.go @@ -80,7 +80,7 @@ type Client struct { LimitIP int `json:"limitIp"` TotalGB int64 `json:"totalGB" form:"totalGB"` ExpiryTime int64 `json:"expiryTime" form:"expiryTime"` - Enable bool `json:"enable" from:"enable"` - TgID string `json:"tgId" from:"tgId"` - SubID string `json:"subId" from:"subId"` + Enable bool `json:"enable" form:"enable"` + TgID string `json:"tgId" form:"tgId"` + SubID string `json:"subId" form:"subId"` } diff --git a/go.mod b/go.mod index f434de5d6a..38269c5295 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/gin-gonic/gin v1.9.0 github.com/go-cmd/cmd v1.4.1 github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1 + github.com/goccy/go-json v0.10.0 github.com/nicksnyder/go-i18n/v2 v2.2.1 github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 github.com/pelletier/go-toml/v2 v2.0.7 @@ -30,7 +31,6 @@ require ( github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.11.2 // indirect - github.com/goccy/go-json v0.10.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/gorilla/context v1.1.1 // indirect github.com/gorilla/securecookie v1.1.1 // indirect diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index 65f4bfd903..a7b43e3fa1 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -106,7 +106,6 @@ Object.freeze(XTLS_FLOW_CONTROL); Object.freeze(TLS_FLOW_CONTROL); Object.freeze(TLS_VERSION_OPTION); Object.freeze(TLS_CIPHER_OPTION); -Object.freeze(UTLS_FINGERPRINT); Object.freeze(ALPN_OPTION); class XrayCommonClass { @@ -177,7 +176,6 @@ class TcpStreamSettings extends XrayCommonClass { this.type = type; this.request = request; this.response = response; - this.acceptProxyProtocol = acceptProxyProtocol; } static fromJson(json={}) { @@ -185,9 +183,8 @@ class TcpStreamSettings extends XrayCommonClass { if (!header) { header = {}; } - return new TcpStreamSettings( + return new TcpStreamSettings(json.acceptProxyProtocol, header.type, - json.acceptProxyProtocol, TcpStreamSettings.TcpRequest.fromJson(header.request), TcpStreamSettings.TcpResponse.fromJson(header.response), ); @@ -201,7 +198,6 @@ class TcpStreamSettings extends XrayCommonClass { request: this.type === 'http' ? this.request.toJson() : undefined, response: this.type === 'http' ? this.response.toJson() : undefined, }, - acceptProxyProtocol: this.acceptProxyProtocol, }; } } @@ -994,6 +990,7 @@ class Inbound extends XrayCommonClass { case Protocols.VMESS: case Protocols.VLESS: case Protocols.TROJAN: + case Protocols.SHADOWSOCKS: return true; default: return false; diff --git a/web/html/xui/form/protocol/trojan.html b/web/html/xui/form/protocol/trojan.html index 79e797c695..91fd7afd51 100644 --- a/web/html/xui/form/protocol/trojan.html +++ b/web/html/xui/form/protocol/trojan.html @@ -32,7 +32,7 @@ - + {{ i18n "none" }} [[ key ]] diff --git a/web/html/xui/form/protocol/vless.html b/web/html/xui/form/protocol/vless.html index 2da4a25570..029f2c9ee1 100644 --- a/web/html/xui/form/protocol/vless.html +++ b/web/html/xui/form/protocol/vless.html @@ -20,25 +20,25 @@ - - {{ i18n "pages.inbounds.IPLimit" }} - - - - - - + + {{ i18n "pages.inbounds.IPLimit" }} + + + + + + - + {{ i18n "none" }} [[ key ]] - + {{ i18n "none" }} [[ key ]] @@ -66,8 +66,8 @@ + :dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''" + v-model="client._expiryTime" style="width: 170px;"> diff --git a/web/html/xui/form/stream/stream_tcp.html b/web/html/xui/form/stream/stream_tcp.html index 32495a807f..958f8f25dc 100644 --- a/web/html/xui/form/stream/stream_tcp.html +++ b/web/html/xui/form/stream/stream_tcp.html @@ -4,7 +4,7 @@ - + diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index 2d6016f3cf..0ea018afda 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -262,7 +262,7 @@ { title: '{{ i18n "pages.inbounds.operate" }}', width: 70, scopedSlots: { customRender: 'actions' } }, { title: '{{ i18n "pages.inbounds.enable" }}', width: 30, scopedSlots: { customRender: 'enable' } }, { title: '{{ i18n "pages.inbounds.client" }}', width: 80, scopedSlots: { customRender: 'client' } }, - { title: '{{ i18n "pages.inbounds.traffic" }}↑|↓', width: 70, scopedSlots: { customRender: 'traffic' } }, + { title: '{{ i18n "pages.inbounds.traffic" }}↑|↓', width: 120, scopedSlots: { customRender: 'traffic' } }, { title: '{{ i18n "pages.inbounds.expireDate" }}', width: 70, scopedSlots: { customRender: 'expiryTime' } }, { title: 'UID', width: 120, dataIndex: "id" }, ]; @@ -271,9 +271,9 @@ { title: '{{ i18n "pages.inbounds.operate" }}', width: 70, scopedSlots: { customRender: 'actions' } }, { title: '{{ i18n "pages.inbounds.enable" }}', width: 30, scopedSlots: { customRender: 'enable' } }, { title: '{{ i18n "pages.inbounds.client" }}', width: 80, scopedSlots: { customRender: 'client' } }, - { title: '{{ i18n "pages.inbounds.traffic" }}↑|↓', width: 70, scopedSlots: { customRender: 'traffic' } }, + { title: '{{ i18n "pages.inbounds.traffic" }}↑|↓', width: 120, scopedSlots: { customRender: 'traffic' } }, { title: '{{ i18n "pages.inbounds.expireDate" }}', width: 70, scopedSlots: { customRender: 'expiryTime' } }, - { title: 'Password', width: 100, dataIndex: "password" }, + { title: 'Password', width: 120, dataIndex: "password" }, ]; const app = new Vue({