From 02a4f0c7d4c9576b913008bdfa6b1186f204f5f2 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Wed, 5 Apr 2023 11:13:49 +0200 Subject: [PATCH] v0.5.0 with ALPN h3 --- web/assets/js/model/xray.js | 1 + web/controller/sub.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/web/assets/js/model/xray.js b/web/assets/js/model/xray.js index d67747035b..b702f850e8 100644 --- a/web/assets/js/model/xray.js +++ b/web/assets/js/model/xray.js @@ -93,6 +93,7 @@ const UTLS_FINGERPRINT = { }; const ALPN_OPTION = { + H3: "h3", H2: "h2", HTTP1: "http/1.1", }; diff --git a/web/controller/sub.go b/web/controller/sub.go index 122c60d1f2..5695f032d1 100644 --- a/web/controller/sub.go +++ b/web/controller/sub.go @@ -2,6 +2,7 @@ package controller import ( "encoding/base64" + "strings" "x-ui/web/service" "github.com/gin-gonic/gin" @@ -27,7 +28,7 @@ func (a *SUBController) initRouter(g *gin.RouterGroup) { func (a *SUBController) subs(c *gin.Context) { subId := c.Param("subid") - host := c.Request.URL.Hostname() + host := strings.Split(c.Request.Host, ":")[0] subs, err := a.subService.GetSubs(subId, host) if err != nil { c.String(400, "Error!")