From d677374a9fadae9028d51a669c7feb3a83c21e8f Mon Sep 17 00:00:00 2001 From: Mohammad Date: Mon, 6 Jan 2025 16:09:26 +0330 Subject: [PATCH] fix: clash tcp http config --- app/subscription/clash.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/subscription/clash.py b/app/subscription/clash.py index 2147ae62e..b987d5eb2 100644 --- a/app/subscription/clash.py +++ b/app/subscription/clash.py @@ -2,18 +2,18 @@ import json from random import choice from uuid import UUID -from app.utils.helpers import yml_uuid_representer import yaml from jinja2.exceptions import TemplateNotFound from app.subscription.funcs import get_grpc_gun from app.templates import render_template +from app.utils.helpers import yml_uuid_representer from config import ( CLASH_SETTINGS_TEMPLATE, CLASH_SUBSCRIPTION_TEMPLATE, MUX_TEMPLATE, - USER_AGENT_TEMPLATE + USER_AGENT_TEMPLATE, ) @@ -173,6 +173,8 @@ def make_node(self, if type == 'shadowsocks': type = 'ss' + if network in ("http", "h2", "h3"): + network = "h2" if network in ('tcp', 'raw') and headers == 'http': network = 'http' if network == 'httpupgrade': @@ -180,9 +182,6 @@ def make_node(self, is_httpupgrade = True else: is_httpupgrade = False - if network in ("http", "h2", "h3"): - network = "h2" - node = { 'name': remark, 'type': type,