From f305cae2a3b204dd292b8132bd66a1fa923809fd Mon Sep 17 00:00:00 2001 From: iambabyninja Date: Thu, 2 Jan 2025 23:38:05 +0500 Subject: [PATCH] small fix --- index.html | 98 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 72 insertions(+), 26 deletions(-) diff --git a/index.html b/index.html index f3805c4..d6bfa61 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ Xray Config Validator - + - +
@@ -196,7 +194,7 @@
- Loading Xray… + Loading…
@@ -226,7 +224,7 @@

Xray Config Validator

const result = await WebAssembly.instantiateStreaming(fetch('main.wasm'), go.importObject); go.run(result.instance); await isReady; - document.getElementById("version-info").innerText = `${XrayGetVersion()}`; + document.getElementById("version-info").innerText = `v${XrayGetVersion()}`; } catch (error) { console.error("Error loading WASM:", error); document.getElementById("version-info").innerText = "Error loading Xray. Check the browser console."; @@ -237,7 +235,7 @@

Xray Config Validator

} })(); - require.config({ paths: { 'vs': 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.52.0/min/vs' } }); + require.config({ paths: { 'vs': 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.52.2/min/vs' } }); require(['vs/editor/editor.main'], async function () { const editorElement = document.getElementById('editor'); @@ -320,7 +318,7 @@

Xray Config Validator

editor.layout(); }); - const brotli = await import("https://unpkg.com/brotli-wasm@3.0.0/index.web.js?module").then(m => m.default); + const brotli = await import("https://unpkg.com/brotli-wasm@3.0.1/index.web.js?module").then(m => m.default); const textEncoder = new TextEncoder(); const textDecoder = new TextDecoder('utf-8'); @@ -362,7 +360,55 @@

Xray Config Validator

let encodedConfig = urlParams.get('c'); function setDefaultConfigValue() { - editor.setValue(`{}`); + editor.setValue(`{ + "inbounds": [ + { + "listen": "127.0.0.1", + "port": 10808, + "protocol": "socks", + "settings": { + "udp": true + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls" + ] + } + } + ], + "outbounds": [ + { + "protocol": "vless", + "settings": { + "vnext": [ + { + "address": "", + "port": 443, + "users": [ + { + "id": "user", + "encryption": "none", + "flow": "xtls-rprx-vision" + } + ] + } + ] + }, + "streamSettings": { + "network": "raw", + "security": "tls", + "tlsSettings": { + "serverName": "", + "allowInsecure": false, + "fingerprint": "chrome" + } + }, + "tag": "proxy" + } + ] +}`); } function decodeAndLoadConfig(encodedConfig) {