✨ ini批量端口
This commit is contained in:
parent
60fbc354d0
commit
e4cd09d1dc
@ -33,6 +33,13 @@ const getFrpcVersionWorkerPath = (
|
||||
});
|
||||
};
|
||||
|
||||
const isRangePort = (m: Proxy) => {
|
||||
return (
|
||||
(m.localPort.indexOf("-") !== -1 || m.localPort.indexOf(",") !== -1) &&
|
||||
(m.type === "tcp" || m.type === "udp")
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* 生成toml配置文件
|
||||
* @param config
|
||||
@ -40,9 +47,7 @@ const getFrpcVersionWorkerPath = (
|
||||
*/
|
||||
export const genTomlConfig = (config: FrpConfig, proxys: Proxy[]) => {
|
||||
const proxyToml = proxys.map(m => {
|
||||
const rangePort =
|
||||
(m.localPort.indexOf("-") !== -1 || m.localPort.indexOf(",") !== -1) &&
|
||||
(m.type === "tcp" || m.type === "udp");
|
||||
const rangePort = isRangePort(m);
|
||||
let toml = `
|
||||
${
|
||||
rangePort
|
||||
@ -197,8 +202,9 @@ ${proxyToml.join("")}
|
||||
*/
|
||||
export const genIniConfig = (config: FrpConfig, proxys: Proxy[]) => {
|
||||
const proxyIni = proxys.map(m => {
|
||||
const rangePort = isRangePort(m);
|
||||
let ini = `
|
||||
[${m.name}]
|
||||
[${rangePort ? 'range:' : ''}${m.name}]
|
||||
type = "${m.type}"
|
||||
`;
|
||||
switch (m.type) {
|
||||
|
Loading…
Reference in New Issue
Block a user