* * @param {string} userID * @param {string | null} hostName * @returns {string}
(userID, hostName)
| 600 | * @returns {string} |
| 601 | */ |
| 602 | function getVLESSConfig(userID, hostName) { |
| 603 | const outboundConfig = { |
| 604 | "protocol": "vless", |
| 605 | "settings": { |
| 606 | "vnext": [ |
| 607 | { |
| 608 | "address": hostName, |
| 609 | "port": 443, |
| 610 | "users": [ |
| 611 | { |
| 612 | "id": userID, |
| 613 | "level": 0, |
| 614 | "encryption": "none" |
| 615 | } |
| 616 | ] |
| 617 | } |
| 618 | ] |
| 619 | }, |
| 620 | "streamSettings": { |
| 621 | "network": "ws", |
| 622 | "security": "tls", |
| 623 | "tlsSettings": { |
| 624 | "serverName": hostName, |
| 625 | "allowInsecure": false |
| 626 | }, |
| 627 | "wsSettings": { |
| 628 | "path": "/?ed=2048", |
| 629 | "headers": { |
| 630 | "Host": hostName |
| 631 | } |
| 632 | } |
| 633 | }, |
| 634 | "tag": "cloudflare" |
| 635 | }; |
| 636 | |
| 637 | return JSON.stringify(outboundConfig, null, 2); |
| 638 | } |