加密传输,代码优化

This commit is contained in:
刘河
2019-01-03 01:44:45 +08:00
parent 4dad726129
commit 1d89e7dae2
16 changed files with 725 additions and 208 deletions

View File

@@ -7,7 +7,7 @@
<input type="hidden" name="vKey" value="{{.t.VerifyKey}}">
<div class="form-group">
<label class="control-label">模式</label>
<select class="form-control" name="type" id="type">
<select class="form-control" name="type" id="type">
<option {{if eq "tunnelServer" .t.Mode}}selected{{end}} value="tunnelServer">tcp隧道</option>
<option {{if eq "udpServer" .t.Mode}}selected{{end}} value="udpServer">udp隧道</option>
<option {{if eq "sock5Server" .t.Mode}}selected{{end}} value="sock5Server">socks5代理</option>
@@ -29,10 +29,16 @@
<label class="control-label">数据压缩方式(所有模式均支持)</label>
<select class="form-control" name="compress">
<option {{if eq "" .t.Compress}}selected{{end}} value="">不压缩</option>
<option {{if eq "gzip" .t.Compress}}selected{{end}} value="gzip">gzip压缩</option>
<option {{if eq "snappy" .t.Compress}}selected{{end}} value="snappy">snappy压缩</option>
</select>
</div>
<div class="form-group" id="compress">
<label class="control-label">是否加密传输(所有模式均支持)</label>
<select class="form-control" name="crypt">
<option {{if eq "0" .t.Crypt}}selected{{end}} value="0">不加密</option>
<option {{if eq "1" .t.Crypt}}selected{{end}} value="1">加密</option>
</select>
</div>
<div class="form-group" id="u">
<label class="control-label">验证用户名(socks5HTTP代理模式)</label>
<input class="form-control" value="{{.t.U}}" type="text" name="u"
@@ -56,7 +62,7 @@
</main>
<script>
var arr = []
arr["all"] = ["type", "port", "compress", "u", "p","target"]
arr["all"] = ["type", "port", "compress", "u", "p", "target"]
arr["tunnelServer"] = ["type", "port", "target", "compress"]
arr["udpServer"] = ["type", "port", "target", "compress"]
arr["sock5Server"] = ["type", "port", "compress", "u", "p"]
@@ -72,6 +78,7 @@
$("#" + arr[o][i]).css("display", "block")
}
}
$(function () {
resetForm()
$("#type").on("change", function () {