Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] <新增vmess-httpupgrade节点支持> #793

Open
3 tasks done
lunarf1ame opened this issue Oct 28, 2024 · 0 comments
Open
3 tasks done

[Feature] <新增vmess-httpupgrade节点支持> #793

lunarf1ame opened this issue Oct 28, 2024 · 0 comments

Comments

@lunarf1ame
Copy link

verify

  • 我已经仔细阅读项目文档,确认现有功能无法解决我的需求
  • 我已经检索过现有issue,确认与现有issue的内容并不重复
  • 我已经尝试自行解决,确认自己没有能力解决

功能描述

当前最新版本的subconverter不支持network(传输协议):httpupgradevmess链接转换为clash配置:

Address(地址): 38.114.103.52

Port(端口): 12345

UUID(用户id): 8dcdd2a3-c9d8-4d72-a5d1-e9fac7c74918

alterId(额外ID): 0

security(加密方式): auto

network(传输协议): httpupgrade

headerType(伪装类型): none

伪装域名(host): http2.8084726.xyz

路径(path):github.com/Alvin9999

底层传输安全(TLS):不填

src/generator/config/subexport.cpp310行中:

        case ProxyType::VMess:
            singleproxy["type"] = "vmess";
            singleproxy["uuid"] = x.UserId;
            singleproxy["alterId"] = x.AlterId;
            singleproxy["cipher"] = x.EncryptMethod;
            singleproxy["tls"] = x.TLSSecure;
            if(!scv.is_undef())
                singleproxy["skip-cert-verify"] = scv.get();
            if(!x.ServerName.empty())
                singleproxy["servername"] = x.ServerName;
            switch(hash_(x.TransferProtocol))
            {
            case "tcp"_hash:
                break;
            case "ws"_hash:
                singleproxy["network"] = x.TransferProtocol;
                if(ext.clash_new_field_name)
                {
                    singleproxy["ws-opts"]["path"] = x.Path;
                    if(!x.Host.empty())
                        singleproxy["ws-opts"]["headers"]["Host"] = x.Host;
                    if(!x.Edge.empty())
                        singleproxy["ws-opts"]["headers"]["Edge"] = x.Edge;
                }
                else
                {
                    singleproxy["ws-path"] = x.Path;
                    if(!x.Host.empty())
                        singleproxy["ws-headers"]["Host"] = x.Host;
                    if(!x.Edge.empty())
                        singleproxy["ws-headers"]["Edge"] = x.Edge;
                }
                break;
            case "http"_hash:
                singleproxy["network"] = x.TransferProtocol;
                singleproxy["http-opts"]["method"] = "GET";
                singleproxy["http-opts"]["path"].push_back(x.Path);
                if(!x.Host.empty())
                    singleproxy["http-opts"]["headers"]["Host"].push_back(x.Host);
                if(!x.Edge.empty())
                    singleproxy["http-opts"]["headers"]["Edge"].push_back(x.Edge);
                break;
            case "h2"_hash:
                singleproxy["network"] = x.TransferProtocol;
                singleproxy["h2-opts"]["path"] = x.Path;
                if(!x.Host.empty())
                    singleproxy["h2-opts"]["host"].push_back(x.Host);
                break;
            case "grpc"_hash:
                singleproxy["network"] = x.TransferProtocol;
                singleproxy["servername"] = x.Host;
                singleproxy["grpc-opts"]["grpc-service-name"] = x.Path;
                break;
            default:
                continue;
            }
            break;

可能的解决方案

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant