增加对udp的支持

This commit is contained in:
刘嘉伟 2024-08-11 15:12:45 +08:00
parent ff1b7fbb35
commit b2f7d8adb3
2 changed files with 96 additions and 88 deletions

View File

@ -49,6 +49,7 @@ localPort = ${m.localPort}
`; `;
switch (m.type) { switch (m.type) {
case "tcp": case "tcp":
case "udp":
toml += `remotePort = ${m.remotePort}`; toml += `remotePort = ${m.remotePort}`;
break; break;
case "http": case "http":
@ -117,6 +118,7 @@ local_port = ${m.localPort}
`; `;
switch (m.type) { switch (m.type) {
case "tcp": case "tcp":
case "udp":
ini += `remote_port = ${m.remotePort}`; ini += `remote_port = ${m.remotePort}`;
break; break;
case "http": case "http":

View File

@ -347,6 +347,8 @@ onUnmounted(() => {
<el-radio label="http" model-value="http"/> <el-radio label="http" model-value="http"/>
<el-radio label="https" model-value="https"/> <el-radio label="https" model-value="https"/>
<el-radio label="tcp" model-value="tcp"/> <el-radio label="tcp" model-value="tcp"/>
<el-radio label="udp" model-value="udp"/>
<!-- <el-radio label="stcp" model-value="stcp" />-->
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -372,7 +374,7 @@ onUnmounted(() => {
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<template v-if="editForm.type === 'tcp'"> <template v-if="editForm.type === 'tcp' || editForm.type === 'udp'">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="外网端口:" prop="remotePort"> <el-form-item label="外网端口:" prop="remotePort">
<el-input-number <el-input-number
@ -467,6 +469,10 @@ onUnmounted(() => {
background: #5f3bb0; background: #5f3bb0;
} }
.udp {
background: #5ec7fe;
}
.domain-input { .domain-input {
width: calc(100% - 115px); width: calc(100% - 115px);
} }