From 4494393fb2a0356481af301e805218e8965e8090 Mon Sep 17 00:00:00 2001 From: Nima Saberi Date: Wed, 14 Feb 2024 13:31:33 +0330 Subject: [PATCH] fixed: vmess path --- assets/js/script.js | 10 +++++++--- index.html | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/assets/js/script.js b/assets/js/script.js index b154515..6801eb2 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -174,13 +174,17 @@ $(document).on('keyup', '#defConfig', function(e) { $('#grpcMode option').removeAttr('selected'); $('#grpcMode option[value="'+ (defConfig.type === 'multi' ? 'multi' : 'gun') +'"]').attr('selected', 'selected').prop('selected', true); - $('#serviceName').val(defConfig.path); + if ( defConfig.net !== 'ws' ) { + $('#serviceName').val(defConfig.path); + } } else { $('#cleanIp').val(defConfig.address); $('#grpcMode option').removeAttr('selected'); $('#grpcMode option[value="'+ (defConfig.mode === 'multi' ? 'multi' : 'gun') +'"]').attr('selected', 'selected').prop('selected', true); - $('#serviceName').val(defConfig.serviceName); + if ( defConfig.type !== 'ws' ) { + $('#serviceName').val(defConfig.serviceName); + } } if ( typeof defConfig.allowInsecure !== "undefined" ) { if ( protocol === 'vmess' ) { @@ -222,7 +226,7 @@ $(document).on('keyup', '#defConfig', function(e) { if ( stream !== 'ws' ) { $('#early').prop('checked', false); } - let path = setPath(defConfig.type === 'ws' ? defConfig.path : ""); + let path = setPath(protocol !== 'vmess' && defConfig.type === 'ws' || protocol === 'vmess' && defConfig.net === 'ws' ? defConfig.path : ""); let early = $('#early').is(':checked'); if ( early && stream === 'ws' ) { path = path+'?ed=2048'; diff --git a/index.html b/index.html index af870cb..c3ff034 100644 --- a/index.html +++ b/index.html @@ -246,7 +246,7 @@ - +