2018-12-11 08:37:12 +00:00
|
|
|
|
<div class="row tile">
|
|
|
|
|
<div class="col-md-6 col-md-auto">
|
|
|
|
|
<div>
|
|
|
|
|
<h3 class="tile-title">添加</h3>
|
|
|
|
|
<div class="tile-body">
|
|
|
|
|
<form>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="control-label">模式</label>
|
|
|
|
|
<select class="form-control" name="type" id="type">
|
2019-02-15 14:59:28 +00:00
|
|
|
|
<option {{if eq "tcpServer" .type}}selected{{end}} value="tcpServer">tcp隧道</option>
|
2018-12-11 08:37:12 +00:00
|
|
|
|
<option {{if eq "udpServer" .type}}selected{{end}} value="udpServer">udp隧道</option>
|
2019-01-09 12:33:00 +00:00
|
|
|
|
<option {{if eq "socks5Server" .type}}selected{{end}} value="socks5Server">socks5代理</option>
|
2018-12-11 08:37:12 +00:00
|
|
|
|
<option {{if eq "httpProxyServer" .type}}selected{{end}} value="httpProxyServer">http代理
|
2019-02-23 15:29:48 +00:00
|
|
|
|
<option {{if eq "secretServer" .type}}selected{{end}} value="secretServer">私密代理
|
2018-12-11 08:37:12 +00:00
|
|
|
|
</select>
|
|
|
|
|
</div>
|
2019-01-25 04:10:12 +00:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="control-label">备注</label>
|
|
|
|
|
<input class="form-control" type="text" name="remark" placeholder="备注">
|
|
|
|
|
</div>
|
2018-12-11 08:37:12 +00:00
|
|
|
|
<div class="form-group" id="port">
|
|
|
|
|
<label class="control-label">监听的端口</label>
|
|
|
|
|
<input class="form-control" type="text" name="port" placeholder="公网服务器对外访问端口,例如8024">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group" id="target">
|
|
|
|
|
<label class="control-label">内网目标(ip:端口)</label>
|
|
|
|
|
<input class="form-control" type="text" name="target" placeholder="内网代理地址,例如10.1.50.203:22">
|
|
|
|
|
</div>
|
2019-01-25 04:10:12 +00:00
|
|
|
|
<div class="form-group" id="client_id">
|
|
|
|
|
<label class="control-label">客户端ID</label>
|
|
|
|
|
<input value="{{.client_id}}" class="form-control" type="text" name="client_id"
|
|
|
|
|
placeholder="客户端id">
|
|
|
|
|
</div>
|
2019-02-23 15:29:48 +00:00
|
|
|
|
<div class="form-group" id="password">
|
|
|
|
|
<label class="control-label">私密模式唯一密钥</label>
|
|
|
|
|
<input class="form-control" type="text" name="password"
|
|
|
|
|
placeholder="私密模式唯一密钥">
|
|
|
|
|
</div>
|
2018-12-11 08:37:12 +00:00
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tile-footer">
|
|
|
|
|
<button class="btn btn-success" href="#" id="add"><i
|
|
|
|
|
class="fa fa-fw fa-lg fa-eye"></i>添加
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</main>
|
|
|
|
|
<script>
|
|
|
|
|
var arr = []
|
|
|
|
|
arr["all"] = ["type", "port", "compress", "u", "p", "target"]
|
2019-02-15 14:59:28 +00:00
|
|
|
|
arr["tcpServer"] = ["type", "port", "target", "compress", "u", "p", "tcp隧道模式,提供一条tcp隧道,适用于ssh、远程桌面等,添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后,访问公网服务器的设定端口,则相当于访问内网目标地址的目标端口"]
|
2018-12-11 08:37:12 +00:00
|
|
|
|
arr["udpServer"] = ["type", "port", "target", "compress", "udp隧道模式,提供一条udp隧道,适用于dns、内网dns访问等,添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后,访问公网服务器的设定端口,则相当于访问内网目标地址的udp目标端口"]
|
2019-01-09 12:33:00 +00:00
|
|
|
|
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代理,即访问内网设备或者资源 "]
|
2018-12-30 14:36:15 +00:00
|
|
|
|
arr["httpProxyServer"] = ["type", "port", "compress", "u", "p", " http代理模式,内网http代理,可访问内网网站,添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后,在外网环境下本机配置http代理,即访问内网站点"]
|
2019-02-23 15:29:48 +00:00
|
|
|
|
arr["secretServer"] = ["type", "target", "compress", "password", "u", "p", " http代理模式,内网http代理,可访问内网网站,添加后会自动生成一个客户端验证key<br>在内网机器执行<span style='color: red'>./easyProxy -vkey=生成的key -server=公网服务器ip:下面设定的端口</span><br>建立成功后,在外网环境下本机配置http代理,即访问内网站点"]
|
2019-01-25 04:10:12 +00:00
|
|
|
|
arrClientHide = ["compress", "u", "p", "crypt", "mux"]
|
2018-12-11 08:37:12 +00:00
|
|
|
|
|
2018-12-30 14:36:15 +00:00
|
|
|
|
function resetForm() {
|
|
|
|
|
for (var i = 0; i < arr["all"].length; i++) {
|
|
|
|
|
$("#" + arr["all"][i]).css("display", "none")
|
2018-12-11 08:37:12 +00:00
|
|
|
|
}
|
2018-12-30 14:36:15 +00:00
|
|
|
|
o = $("#type option:selected").val()
|
|
|
|
|
for (var i = 0; i < arr[o].length - 1; i++) {
|
|
|
|
|
$("#" + arr[o][i]).css("display", "block")
|
|
|
|
|
}
|
|
|
|
|
$("#info").html(arr[o][arr[o].length - 1])
|
|
|
|
|
}
|
2018-12-11 08:37:12 +00:00
|
|
|
|
|
2019-01-25 04:10:12 +00:00
|
|
|
|
function resetClientCnf() {
|
|
|
|
|
for (var i = 0; i < arrClientHide.length; i++) {
|
|
|
|
|
$("#" + arrClientHide[i]).css("display", "block")
|
|
|
|
|
}
|
|
|
|
|
op = $("#use_client option:selected").val()
|
|
|
|
|
if (op == 1) {
|
|
|
|
|
for (var i = 0; i < arrClientHide.length; i++) {
|
|
|
|
|
$("#" + arrClientHide[i]).css("display", "none")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-30 14:36:15 +00:00
|
|
|
|
$(function () {
|
|
|
|
|
resetForm()
|
2019-01-25 04:10:12 +00:00
|
|
|
|
resetClientCnf()
|
2018-12-30 14:36:15 +00:00
|
|
|
|
$("#type").on("change", function () {
|
2018-12-11 08:37:12 +00:00
|
|
|
|
resetForm()
|
2019-01-25 04:10:12 +00:00
|
|
|
|
resetClientCnf()
|
|
|
|
|
})
|
|
|
|
|
$("#use_client").on("change", function () {
|
|
|
|
|
resetForm()
|
|
|
|
|
resetClientCnf()
|
2018-12-30 14:36:15 +00:00
|
|
|
|
})
|
|
|
|
|
$("#add").on("click", function () {
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
url: "/index/add",
|
|
|
|
|
data: $("form").serializeArray(),
|
|
|
|
|
success: function (res) {
|
|
|
|
|
alert(res.msg)
|
|
|
|
|
if (res.status) {
|
|
|
|
|
history.back(-1)
|
2018-12-11 08:37:12 +00:00
|
|
|
|
}
|
2018-12-30 14:36:15 +00:00
|
|
|
|
}
|
2018-12-11 08:37:12 +00:00
|
|
|
|
})
|
|
|
|
|
})
|
2018-12-30 14:36:15 +00:00
|
|
|
|
})
|
2018-12-11 08:37:12 +00:00
|
|
|
|
</script>
|