Added Zoraxy experimental

This commit is contained in:
Toby Chui
2023-04-13 22:07:38 +08:00
parent 85c816ecd7
commit b5f3234d45
285 changed files with 20145 additions and 1277 deletions

View File

@@ -0,0 +1,61 @@
<h3><i class="ui home icon"></i> Set Proxy Root</h3>
<p>For all routing not found in the proxy rule, will be redirected to the proxy root server.</p>
<div class="ui form">
<div class="field">
<label>Proxy Root</label>
<input type="text" id="proxyRoot">
<small>E.g. localhost:8080</small>
</div>
<div class="field">
<div class="ui checkbox">
<input type="checkbox" id="rootReqTLS">
<label>Root require TLS Connection <br><small>(i.e. Your proxy target starts with https://)</small></label>
</div>
</div>
</div>
<br>
<button class="ui teal button" onclick="setProxyRoot()"><i class="home icon" ></i> Set Proxy Root</button>
<div class="ui green message" id="ProxyRootUpdate" style="display:none">
<i class="ui checkmark icon"></i> Proxy Root Updated
</div>
<script>
function initRootInfo(){
$.get("/api/proxy/list?type=root", function(data){
if (data == null){
}else{
$("#proxyRoot").val(data.Domain);
}
});
}
initRootInfo();
function setProxyRoot(){
var newpr = $("#proxyRoot").val();
if (newpr.trim() == ""){
$("#proxyRoot").parent().addClass('error');
return
}else{
$("#proxyRoot").parent().removeClass('error');
}
var rootReqTls = $("#rootReqTLS")[0].checked;
//Create the endpoint by calling add
$.ajax({
url: "/api/proxy/add",
data: {"type": "root", tls: rootReqTls, ep: newpr},
success: function(data){
if (data.error != undefined){
alert(data.error);
}else{
//OK
initRootInfo();
$("#ProxyRootUpdate").stop().slideDown('fast').delay(3000).slideUp('fast');
}
}
});
}
</script>