diff --git a/.env.example b/.env.example index e52ce84f..4f5fb79c 100644 --- a/.env.example +++ b/.env.example @@ -4,7 +4,8 @@ BUILD_WITH_ANTIZAPRET="0" XUI_SERVER_IP="" XUI_PANEL_DOMAIN="" XUI_SUB_DOMAIN="" -XUI_VLESS_SNI="" +XUI_VLESS_REALITY_SNI="" +XUI_VLESS_GRPC_SNI="" #XUI_SUB_PROFILE_TITLE="" #XUI_SUB_SUPPORT_URL="" #XUI_SUB_PROFILE_WEB_PAGE_URL="" diff --git a/docker-compose.yml b/docker-compose.yml index 35ede245..b70125e6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,10 +24,16 @@ services: - "traefik.http.routers.3x-ui-sub.entrypoints=https" - "traefik.http.services.3x-ui-sub.loadbalancer.server.port=2096" # - - "traefik.tcp.routers.vless.rule=HostSNI(`${XUI_VLESS_SNI}`)" - - "traefik.tcp.routers.vless.tls.passthrough=true" - - "traefik.tcp.routers.vless.service=3x-ui-inbound-443" + - "traefik.tcp.routers.vless-reality.rule=HostSNI(`${XUI_VLESS_REALITY_SNI}`)" + - "traefik.tcp.routers.vless-reality.tls.passthrough=true" + - "traefik.tcp.routers.vless-reality.service=3x-ui-inbound-443" - "traefik.tcp.services.3x-ui-inbound-443.loadbalancer.server.port=443" + # + - "traefik.tcp.routers.vless-grpc.rule=HostSNI(`${XUI_VLESS_GRPC_SNI}`)" + - "traefik.tcp.routers.vless-grpc.tls.passthrough=true" + - "traefik.tcp.routers.vless-grpc.entrypoints=https" + - "traefik.tcp.routers.vless-grpc.service=3x-ui-inbound-8888" + - "traefik.tcp.services.3x-ui-inbound-8888.loadbalancer.server.port=8888" volumes: - ./db/:/etc/x-ui/ - ./db/fail2ban.sqlite3:/var/lib/fail2ban/fail2ban.sqlite3 diff --git a/sub/subController.go b/sub/subController.go index a59a3383..b675bdb8 100644 --- a/sub/subController.go +++ b/sub/subController.go @@ -59,11 +59,8 @@ func (a *SUBController) initRouter(g *gin.RouterGroup) { func (a *SUBController) subs(c *gin.Context) { subId := c.Param("subid") var host string - host = os.Getenv("XUI_SERVER_IP") - if host == "" { - if h, err := getHostFromXFH(c.GetHeader("X-Forwarded-Host")); err == nil { - host = h - } + if h, err := getHostFromXFH(c.GetHeader("X-Forwarded-Host")); err == nil { + host = h } if host == "" { host = c.GetHeader("X-Real-IP") @@ -122,11 +119,8 @@ func (a *SUBController) subs(c *gin.Context) { func (a *SUBController) subJsons(c *gin.Context) { subId := c.Param("subid") var host string - host = os.Getenv("XUI_SERVER_IP") - if host == "" { - if h, err := getHostFromXFH(c.GetHeader("X-Forwarded-Host")); err == nil { - host = h - } + if h, err := getHostFromXFH(c.GetHeader("X-Forwarded-Host")); err == nil { + host = h } if host == "" { host = c.GetHeader("X-Real-IP")