Url路由 泛解析

This commit is contained in:
刘河
2019-02-15 22:59:28 +08:00
parent 44d314515b
commit 9f6b33a62b
26 changed files with 262 additions and 156 deletions

View File

@@ -7,7 +7,7 @@
<div class="form-group">
<label class="control-label">模式</label>
<select class="form-control" name="type" id="type">
<option {{if eq "tunnelServer" .type}}selected{{end}} value="tunnelServer">tcp隧道</option>
<option {{if eq "tcpServer" .type}}selected{{end}} value="tcpServer">tcp隧道</option>
<option {{if eq "udpServer" .type}}selected{{end}} value="udpServer">udp隧道</option>
<option {{if eq "socks5Server" .type}}selected{{end}} value="socks5Server">socks5代理</option>
<option {{if eq "httpProxyServer" .type}}selected{{end}} value="httpProxyServer">http代理
@@ -44,7 +44,7 @@
<script>
var arr = []
arr["all"] = ["type", "port", "compress", "u", "p", "target"]
arr["tunnelServer"] = ["type", "port", "target", "compress", "u", "p", "tcp隧道模式提供一条tcp隧道适用于ssh、远程桌面等添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后,访问公网服务器的设定端口,则相当于访问内网目标地址的目标端口"]
arr["tcpServer"] = ["type", "port", "target", "compress", "u", "p", "tcp隧道模式提供一条tcp隧道适用于ssh、远程桌面等添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后,访问公网服务器的设定端口,则相当于访问内网目标地址的目标端口"]
arr["udpServer"] = ["type", "port", "target", "compress", "udp隧道模式提供一条udp隧道适用于dns、内网dns访问等添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后访问公网服务器的设定端口则相当于访问内网目标地址的udp目标端口"]
arr["socks5Server"] = ["type", "port", "compress", "u", "p", "socks5代理模式内网socks5代理配合proxifer可如同使用vpn一样访问内网设备或资源添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后在外网环境下本机配置socks5代理即访问内网设备或者资源 "]
arr["httpProxyServer"] = ["type", "port", "compress", "u", "p", " http代理模式内网http代理可访问内网网站添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后在外网环境下本机配置http代理即访问内网站点"]

View File

@@ -8,7 +8,7 @@
<div class="form-group">
<label class="control-label">模式</label>
<select class="form-control" name="type" id="type">
<option {{if eq "tunnelServer" .t.Mode}}selected{{end}} value="tunnelServer">tcp隧道</option>
<option {{if eq "tcpServer" .t.Mode}}selected{{end}} value="tcpServer">tcp隧道</option>
<option {{if eq "udpServer" .t.Mode}}selected{{end}} value="udpServer">udp隧道</option>
<option {{if eq "socks5Server" .t.Mode}}selected{{end}} value="socks5Server">socks5代理
</option>
@@ -48,7 +48,7 @@
<script>
var arr = []
arr["all"] = ["type", "port", "compress", "u", "p", "target"]
arr["tunnelServer"] = ["type", "port", "target", "u", "p", "compress"]
arr["tcpServer"] = ["type", "port", "target", "u", "p", "compress"]
arr["udpServer"] = ["type", "port", "target", "compress"]
arr["socks5Server"] = ["type", "port", "compress", "u", "p"]
arr["httpProxyServer"] = ["type", "port", "compress", "u", "p"]

View File

@@ -12,6 +12,10 @@
<label class="control-label">域名</label>
<input class="form-control" type="text" name="host" placeholder="域名">
</div>
<div class="form-group">
<label class="control-label">URL路由(可忽略)</label>
<input class="form-control" type="text" name="location" placeholder="URL路由">
</div>
<div class="form-group">
<label class="control-label">客户端id</label>
<input value="{{.client_id}}" class="form-control" type="text" name="client_id"

View File

@@ -4,10 +4,15 @@
<h3 class="tile-title">修改</h3>
<div class="tile-body">
<form>
<input type="hidden" name="id" value="{{.h.Id}}">
<div class="form-group">
<label class="control-label">域名</label>
<input class="form-control" value="{{.h.Host}}" type="hidden" name="host" placeholder="域名">
<input class="form-control" value="{{.h.Host}}" type="text" name="nhost" placeholder="域名">
<input class="form-control" value="{{.h.Host}}" name="host" placeholder="域名">
</div>
<div class="form-group">
<label class="control-label">URL路由(可忽略)</label>
<input class="form-control" value="{{.h.Location}}" type="text" name="location"
placeholder="URL路由">
</div>
<div class="form-group">
<label class="control-label">备注</label>

View File

@@ -5,6 +5,7 @@
<table class="table table-hover table-bordered" id="sampleTable">
<thead>
<tr>
<th>id</th>
<th>客户端id</th>
<th>备注</th>
<th>host</th>
@@ -30,12 +31,12 @@
</main>
<script type="text/javascript">
function del(host) {
function del(id) {
if (confirm("确定要删除数据吗?")) {
$.ajax({
type: "POST",
url: "/index/delhost",
data: {"host": host},
data: {"id": id},
success: function (res) {
alert(res.msg)
if (res.status) {
@@ -50,8 +51,8 @@
window.location.href = "/index/addhost?vkey={{.task_id}}&client_id={{.client_id}}"
}
function edit(host) {
window.location.href = "/index/edithost?host=" + host
function edit(id) {
window.location.href = "/index/edithost?id=" + id
}
$(document).ready(function () {
@@ -72,6 +73,7 @@
},
dom: '<"top"fl><"toolbar">rt<"bottom"ip><"clear">',
columns: [ //这个是显示到界面上的个数据 格式为 {data:'显示的字段名'}
{data: 'Id'},
{data: 'Remark'},
{data: 'Remark'},
{data: 'Host'},
@@ -91,13 +93,13 @@
render: function (data, type, row, meta) {
return '<div class="btn-group" role="group" aria-label="..."> ' +
'<button onclick="del(\'' + row.Host + '\')" type="button" class="btn btn-danger btn-sm">删除</button>' +
'<button onclick="edit(\'' + row.Host + '\')" type="button" class="btn btn-primary btn-sm">编辑查看</button> '
'<button onclick="del(\'' + row.Id + '\')" type="button" class="btn btn-danger btn-sm">删除</button>' +
'<button onclick="edit(\'' + row.Id + '\')" type="button" class="btn btn-primary btn-sm">编辑查看</button> '
+ ' </div>'
}
},
{
targets: 0,
targets: 1,
render: function (data, type, row, meta) {
return row.Client.Id
}

View File

@@ -107,7 +107,7 @@
radius : '55%',
center: ['50%', '60%'],
data:[
{value:{{.data.tunnelServerCount}}, name:'tcp隧道数'},
{value:{{.data.tcpServerCount}}, name:'tcp隧道数'},
{value:{{.data.socks5ServerCount}}, name:'socks5隧道数'},
{value:{{.data.httpProxyServerCount}}, name:'http隧道数'},
{value:{{.data.udpServerCount}}, name:'udp隧道数'},