[*] 日常优化

This commit is contained in:
acgist
2023-08-17 07:44:43 +08:00
parent 77e244a512
commit 4d977ee74c
3 changed files with 27 additions and 2 deletions

View File

@@ -65,8 +65,9 @@ module.exports = {
], ],
// 日志级别debug | warn | error | none // 日志级别debug | warn | error | none
logLevel : "warn", logLevel : "warn",
// RTP端口范围 // RTP端口范围(最小)
rtcMinPort: process.env.MEDIASOUP_MIN_PORT || 40000, rtcMinPort: process.env.MEDIASOUP_MIN_PORT || 40000,
// RTP端口范围最大
rtcMaxPort: process.env.MEDIASOUP_MAX_PORT || 49999, rtcMaxPort: process.env.MEDIASOUP_MAX_PORT || 49999,
}, },
// Router配置https://mediasoup.org/documentation/v3/mediasoup/api/#RouterOptions // Router配置https://mediasoup.org/documentation/v3/mediasoup/api/#RouterOptions

View File

@@ -20,12 +20,14 @@ import lombok.extern.slf4j.Slf4j;
* @author acgist * @author acgist
*/ */
@Slf4j @Slf4j
public class CipherUtils { public final class CipherUtils {
private CipherUtils() { private CipherUtils() {
} }
/** /**
* 创建加密工具
*
* @param mode 模式 * @param mode 模式
* @param encrypt 算法 * @param encrypt 算法
* @param secret 密钥 * @param secret 密钥

View File

@@ -0,0 +1,22 @@
package com.acgist.taoyao.signal.utils;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import javax.crypto.Cipher;
import org.junit.jupiter.api.Test;
import com.acgist.taoyao.boot.config.SocketProperties.Encrypt;
public class CipherUtilsTest {
@Test
public void testBuildCipher() {
final String secret = "2SPWy+TF1zM=".strip();
assertNull(CipherUtils.buildCipher(Cipher.ENCRYPT_MODE, Encrypt.PLAINTEXT, secret));
assertNull(CipherUtils.buildCipher(Cipher.ENCRYPT_MODE, Encrypt.DES, null));
assertNotNull(CipherUtils.buildCipher(Cipher.ENCRYPT_MODE, Encrypt.DES, secret));
}
}