feat: init proj

This commit is contained in:
2026-03-31 13:11:54 +08:00
commit 8f75ea24d6
38 changed files with 6826 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import type { ParsedNode } from './ss.js';
export function parseTrojan(uri: string): ParsedNode {
const url = new URL(uri);
const name = decodeURIComponent(url.hash.slice(1));
const server = url.hostname;
const port = parseInt(url.port, 10);
const password = url.username;
const params = url.searchParams;
const sni = params.get('sni') || server;
const surgeLine = `${name} = trojan, ${server}, ${port}, password=${password}, tls=true, sni=${sni}, skip-cert-verify=false`;
return { name, type: 'trojan', server, port, surgeLine };
}