diff --git a/electron/api/frpc.ts b/electron/api/frpc.ts index 4326506..e56418d 100644 --- a/electron/api/frpc.ts +++ b/electron/api/frpc.ts @@ -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": diff --git a/src/views/proxy/index.vue b/src/views/proxy/index.vue index 6ace3d5..c18a0da 100644 --- a/src/views/proxy/index.vue +++ b/src/views/proxy/index.vue @@ -147,7 +147,8 @@ const editFormRules = reactive({ { 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); +}