/** * 参考链接 * - clash 文档 https://github.com/Dreamacro/clash/wiki/configuration#proxy-providers * - v2ray utils https://github.com/kltk/v2ray-tools/blob/master/src/vmess2config.js * - https://blog.kingrong.kr/js-decode-for-clash/#yi-yi-dui-ying * */ /** # vmess # cipher support auto/aes-128-gcm/chacha20-poly1305/none - name: "vmess" type: vmess server: server port: 443 uuid: uuid alterId: 32 cipher: auto # udp: true # tls: true # skip-cert-verify: true # servername: example.com # priority over wss host # network: ws # ws-opts: # path: /path # headers: # Host: v2ray.com # max-early-data: 2048 # early-data-header-name: Sec-WebSocket-Protocol - name: "vmess-h2" type: vmess server: server port: 443 uuid: uuid alterId: 32 cipher: auto network: h2 tls: true h2-opts: host: - http.example.com - http-alt.example.com path: / - name: "vmess-http" type: vmess server: server port: 443 uuid: uuid alterId: 32 cipher: auto # udp: true # network: http # http-opts: # # method: "GET" # # path: # # - '/' # # - '/video' # # headers: # # Connection: # # - keep-alive - name: vmess-grpc server: server port: 443 type: vmess uuid: uuid alterId: 32 cipher: auto network: grpc tls: true servername: example.com # skip-cert-verify: true grpc-opts: grpc-service-name: "example" */ export interface ClashVmessProxyItem { 'type': 'vmess'; 'name': string; 'server': string; 'port': number; 'uuid': string; 'alterId': number; 'cipher': ClashVmess.Ciper; 'udp'?: boolean; 'servername'?: string; 'tls'?: boolean; 'skip-cert-verify'?: boolean; 'network'?: ClashVmess.Network; 'ws-opts'?: ClashVmess.WsOpts; 'http-opts'?: ClashVmess.HttpOpts; 'h2-opts'?: ClashVmess.H2Opts; 'grpc-opts'?: ClashVmess.GrpcOpts; } export declare namespace ClashVmess { type Ciper = 'auto' | 'aes-128-gcm' | 'chacha20-poly1305' | 'none'; type Network = 'tcp' | 'http' | 'h2' | 'quic' | 'kcp' | 'ws' | 'grpc'; interface WsOpts { 'path'?: string; 'headers'?: { Host?: string; [key: string]: string | undefined; }; 'max-early-data'?: number; 'early-data-header-name'?: string; } interface HttpOpts { method?: string; path?: string | string[]; headers?: { [key: string]: string | undefined; }; } interface H2Opts { host?: string | string[]; path?: string; [key: string]: any; } interface GrpcOpts { 'grpc-service-name'?: string; [key: string]: any | undefined; } } /** * https://github.com/2dust/v2rayN/wiki/分享链接格式说明(ver-2) */ export interface VmessUrlLine { v: string; ps: string; add: string; port: string; id: string; aid: string; net: ClashVmess.Network; type?: string; scy?: ClashVmess.Ciper; host?: string; path?: string; tls?: string; sni?: string; } export declare function urlLineToClashVmessServer(line: VmessUrlLine): ClashVmessProxyItem;