diff --git a/assets/css/style.css b/assets/css/style.css index c3c206e..76cac71 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -333,7 +333,11 @@ p { display: inline-block; height: 26px; float: left; - margin: 0 7px 0px 0; + margin: 0 7px 0 0; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } .switch input { opacity: 0; diff --git a/assets/js/script.js b/assets/js/script.js index 78f47c0..28d685b 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -127,14 +127,17 @@ $(document).on('keyup', '#defConfig', function(e) { /*if ( ! protocols.includes(protocol) ) { return false; }*/ - $('#uuid').val(getHashId(config)); $('#port').val(getAddress(config)[1]); let defConfig = parser(protocol, config); + $('#sni').val(defConfig.host); if ( (protocol === 'vmess' && defConfig.tls === "tls") || (protocol === 'vless' && defConfig.security === "tls") ) { $('#tls').prop('checked', true); $('#packets').val('tlshello'); $('#length').val('10-20'); $('#interval').val('10-20'); + if ( typeof defConfig.host === "undefined" || typeof defConfig.host !== "undefined" && defConfig.host === "") { + $('#sni').val(defConfig.sni); + } } else { $('#tls').prop('checked', false); @@ -142,7 +145,6 @@ $(document).on('keyup', '#defConfig', function(e) { $('#length').val('3-5'); $('#interval').val('5'); } - $('#sni').val(defConfig.host); if ( protocol === 'vmess' ) { $('#cleanIp').val(defConfig.add); } @@ -161,6 +163,7 @@ $(document).on('keyup', '#defConfig', function(e) { else { path = path.replace('/?ed=2048', '') } + $('#uuid').val(getHashId(defConfig.id)); $('#path').val(path); }); @@ -183,11 +186,13 @@ $(document).on('click', '#tls', function(e) { $('#packets').val('tlshello'); $('#length').val('10-20'); $('#interval').val('10-20'); + $('#sni').attr('placeholder', 'SNI'); } else { $('#packets').val('1-1'); $('#length').val('3-5'); $('#interval').val('5'); + $('#sni').attr('placeholder', 'Host'); } }); @@ -267,7 +272,6 @@ $(document).on('click', '#getFile', function(e) { data.outbounds[0].settings.vnext[0].port = Number(port); data.outbounds[0].settings.vnext[0].users[0].id = uuid; data.outbounds[0].settings.vnext[0].address = cleanIp; - if ( tls ) { data.outbounds[1].settings.fragment.packets = 'tlshello'; data.outbounds[1].settings.fragment.length = '10-20'; diff --git a/index.html b/index.html index b5df423..98d5688 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - +