[+] 合并事件监听还有协议
This commit is contained in:
@@ -20,7 +20,7 @@ server:
|
||||
# context-path: /taoyao
|
||||
spring:
|
||||
profiles:
|
||||
active: dev
|
||||
active: local
|
||||
application:
|
||||
name: taoyao-signal-server
|
||||
servlet:
|
||||
@@ -53,7 +53,7 @@ taoyao:
|
||||
description: 桃夭WebRTC信令服务
|
||||
timeout: 5000
|
||||
id:
|
||||
sn: 0
|
||||
index: 0
|
||||
max-index: 999999
|
||||
# 媒体配置
|
||||
media:
|
||||
@@ -100,14 +100,14 @@ taoyao:
|
||||
resolution: 720*480
|
||||
# 媒体服务配置
|
||||
media-server-list:
|
||||
- name: media-local-a
|
||||
- media-id: media-local-a
|
||||
enabled: true
|
||||
host: localhost
|
||||
port: 4443
|
||||
schema: wss
|
||||
username: taoyao
|
||||
password: taoyao
|
||||
- name: media-local-z
|
||||
- media-id: media-local-z
|
||||
enabled: true
|
||||
host: localhost
|
||||
port: 4443
|
||||
|
||||
@@ -21,11 +21,11 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
public class WebSocketClient {
|
||||
|
||||
public static final WebSocket build(String uri, String sn) throws InterruptedException {
|
||||
return build(uri, sn, null);
|
||||
public static final WebSocket build(String uri, String clientId) throws InterruptedException {
|
||||
return build(uri, clientId, null);
|
||||
}
|
||||
|
||||
public static final WebSocket build(String uri, String sn, CountDownLatch count) throws InterruptedException {
|
||||
public static final WebSocket build(String uri, String clientId, CountDownLatch count) throws InterruptedException {
|
||||
final Object lock = new Object();
|
||||
try {
|
||||
return HttpClient
|
||||
@@ -37,8 +37,8 @@ public class WebSocketClient {
|
||||
@Override
|
||||
public void onOpen(WebSocket webSocket) {
|
||||
webSocket.sendText(String.format("""
|
||||
{"header":{"signal":"client::register","v":"1.0.0","id":"1"},"body":{"username":"taoyao","password":"taoyao","ip":"127.0.0.1","sn":"%s"}}
|
||||
""", sn), true);
|
||||
{"header":{"signal":"client::register","v":"1.0.0","id":"1"},"body":{"username":"taoyao","password":"taoyao","ip":"127.0.0.1","clientId":"%s"}}
|
||||
""", clientId), true);
|
||||
Listener.super.onOpen(webSocket);
|
||||
}
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user