[*] 日常优化
This commit is contained in:
@@ -65,8 +65,9 @@ module.exports = {
|
||||
],
|
||||
// 日志级别:debug | warn | error | none
|
||||
logLevel : "warn",
|
||||
// RTP端口范围
|
||||
// RTP端口范围(最小)
|
||||
rtcMinPort: process.env.MEDIASOUP_MIN_PORT || 40000,
|
||||
// RTP端口范围(最大)
|
||||
rtcMaxPort: process.env.MEDIASOUP_MAX_PORT || 49999,
|
||||
},
|
||||
// Router配置:https://mediasoup.org/documentation/v3/mediasoup/api/#RouterOptions
|
||||
|
||||
@@ -20,12 +20,14 @@ import lombok.extern.slf4j.Slf4j;
|
||||
* @author acgist
|
||||
*/
|
||||
@Slf4j
|
||||
public class CipherUtils {
|
||||
public final class CipherUtils {
|
||||
|
||||
private CipherUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建加密工具
|
||||
*
|
||||
* @param mode 模式
|
||||
* @param encrypt 算法
|
||||
* @param secret 密钥
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user