Skip to content

Commit

Permalink
اعمال یک سری محدودیتها و پیامهای مرتبط
Browse files Browse the repository at this point in the history
  • Loading branch information
ircfspace committed Jan 15, 2024
1 parent 253631c commit 18b97b6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 17 deletions.
46 changes: 31 additions & 15 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,33 +102,49 @@ $(document).on('click', '#checkConf', function(e) {
$('#defConfig').trigger('keyup')
});

function resetForm() {
$('#protocol option').removeAttr('selected');
$('#tls').prop('checked', true);
$('#early').prop('checked', false);
$('#uuid').val("");
$('#port').val("");
$('#sni').val("");
$('#cleanIp').val("");
$('#path').val("");
$('#concurrency').val("");
$('#packets').val('tlshello');
$('#length').val('10-20');
$('#interval').val('10-20');
}

$(document).on('keyup', '#defConfig', function(e) {
e.preventDefault();
let config = $(this).val().trim();
if ( config === '' ) {
//console.clear();
$('#protocol option').removeAttr('selected');
$('#tls').prop('checked', true);
$('#early').prop('checked', false);
$('#uuid').val("");
$('#port').val("");
$('#sni').val("");
$('#cleanIp').val("");
$('#path').val("");
$('#concurrency').val("");
$('#packets').val('tlshello');
$('#length').val('10-20');
$('#interval').val('10-20');
resetForm();
return false;
}
let protocol = getProtocol(config);
if ( ! protocols.includes(protocol) ) {
alert('پروتکل باید Vless یا Vmess باشد!');
resetForm();
return false;
}
$('#protocol option').removeAttr('selected');
$('#protocol option[value="'+protocol+'"]').attr('selected', 'selected');
/*if ( ! protocols.includes(protocol) ) {
let defConfig = parser(protocol, config);
if ( protocol === 'vmess' && ["grpc", "reality", "tcp", "quic"].includes(defConfig.tls) ) {
alert('نوع کانفیگ باید وب‌سوکت باشد!');
resetForm();
return false;
}*/
}
if ( protocol === 'vless' && ["grpc", "reality", "tcp", "quic"].includes(defConfig.security) ) {
alert('نوع کانفیگ باید وب‌سوکت باشد!');
resetForm();
return false;
}
$('#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);
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<link href="./assets/css/bootstrap.min.css" rel="stylesheet" />
<link href="./assets/css/bootstrap-rtl.min.css" rel="stylesheet" />
<link href="./assets/css/vazir.css" rel="stylesheet" />
<link href="./assets/css/style.css?v1.5.8" rel="stylesheet" />
<link href="./assets/css/style.css?v1.5.9" rel="stylesheet" />
<title>IRCF | ابزار فرگمنت</title>
<meta name="description" content="آی پی سالم و تمیز برای کلودفلر (کلادفلر) جهت دسترسی به اینترنت آزاد" />
<meta name="keywords" content="کلودفلر, کلادفلر, cloudflare, cf, آی پی تمیز, آی پی سالم, اسکن آی پی" />
Expand Down Expand Up @@ -188,7 +188,7 @@ <h4 class="modal-title">دونیت</h4>
</div>-->
<script src="./assets/js/jquery.min.js"></script>
<script src="./assets/js/bootstrap.min.js"></script>
<script src="./assets/js/script.js?v1.5.8"></script>
<script src="./assets/js/script.js?v1.5.9"></script>
</footer>
</div>
</div>
Expand Down

0 comments on commit 18b97b6

Please sign in to comment.