🚧 htts2http插件应用

This commit is contained in:
刘嘉伟 2024-12-26 18:00:59 +08:00
parent 5e436ccaf1
commit eaa588698a
2 changed files with 30 additions and 4 deletions

View File

@ -90,18 +90,39 @@ remotePort = ${m.remotePort}
break;
case "http":
case "https":
toml += `
localIP = "${m.localIp}"
localPort = ${m.localPort}
const customDomains = m.customDomains.filter(f1 => f1 !== "");
if (customDomains && customDomains.length > 0) {
toml += `
customDomains=[${m.customDomains.map(m => `"${m}"`)}]
`;
}
if (m.subdomain) {
toml += `
subdomain="${m.subdomain}"
`;
}
if (m.basicAuth) {
toml += `
httpUser = "${m.httpUser}"
httpPassword = "${m.httpPassword}"
`;
}
if (m.https2http) {
toml += `
[proxies.plugin]
type = "https2http"
localAddr = "${m.localIp}:${m.localPort}"
crtPath = "${m.https2httpCaFile}"
keyPath = "${m.https2httpCaFile}"
`;
} else {
toml += `
localIP = "${m.localIp}"
localPort = ${m.localPort}
`;
}
break;
case "stcp":
case "xtcp":

View File

@ -147,7 +147,8 @@ const editFormRules = reactive<FormRules>({
{ required: true, message: "请选择是否开启HTTP基本认证", trigger: "blur" }
],
httpUser: [{ required: true, message: "请输入认证用户名", trigger: "blur" }],
httpPassword: [{ required: true, message: "请输入认证密码", trigger: "blur" }]
httpPassword: [{ required: true, message: "请输入认证密码", trigger: "blur" }],
});
/**
@ -1498,4 +1499,8 @@ onUnmounted(() => {
:deep(.el-drawer__body) {
//padding-top: 0;
}
.button-input {
width: calc(100% - 68px);
}
</style>