@gogoqiu/tencent-http-server 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/gogoqiu-node-http-service +3 -0
- package/dist/build.d.ts +3 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/build.js +3 -0
- package/dist/build.js.map +1 -0
- package/dist/routes/index.d.ts +4 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +106 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +318 -0
- package/dist/server.js.map +1 -0
- package/dist/serverCmd.d.ts +8 -0
- package/dist/serverCmd.d.ts.map +1 -0
- package/dist/serverCmd.js +44 -0
- package/dist/serverCmd.js.map +1 -0
- package/dist/shell/install.d.ts +5 -0
- package/dist/shell/install.d.ts.map +1 -0
- package/dist/shell/install.js +221 -0
- package/dist/shell/install.js.map +1 -0
- package/dist/shell/postinst.d.ts +2 -0
- package/dist/shell/postinst.d.ts.map +1 -0
- package/dist/shell/postinst.js +4 -0
- package/dist/shell/postinst.js.map +1 -0
- package/dist/shell.d.ts +2 -0
- package/dist/shell.d.ts.map +1 -0
- package/dist/shell.js +249 -0
- package/dist/shell.js.map +1 -0
- package/package.json +82 -0
- package/public/captures1//346/265/213/350/257/225/347/224/250captures +0 -0
- package/public/chat/offer.html +796 -0
- package/public/chat/options.html +58 -0
- package/public/chat/server-info.html +32 -0
- package/public/chat2.html +272 -0
- package/public/chat3.html +246 -0
- package/public/chat4.html +302 -0
- package/public/chat5.html +41 -0
- package/public/formdata.html +41 -0
- package/public/hls-player.htm +41 -0
- package/public/img/back.svg +1 -0
- package/public/img/offline.svg +1 -0
- package/public/img/online.svg +1 -0
- package/public/ip-record.html +28 -0
- package/public/js/encrypt.js +36 -0
- package/public/js/socket.io.min.js +7 -0
- package/public/js/socket.io.min.js.map +1 -0
- package/public/myhost/hostReg.html +35 -0
- package/public/mylog-chat.htm +260 -0
- package/public/mylog3.html +245 -0
- package/public/navbar.css +17 -0
- package/public/readme.txt +3 -0
- package/public/scroll.htm +139 -0
- package/public/ssh-client.html +0 -0
- package/public/upload-file.html +226 -0
- package/public/upload.html +23 -0
- package/public/uploads1/files-1757866537383-447469495.jpg +0 -0
- package/public/uploads1/files-1757867389485-764531720.jpg +0 -0
- package/public/uploads1/files-1757867518311-278635302.jpg +0 -0
- package/public/uploads1/files-1757867629687-688924576.jpg +0 -0
- package/public/uploads1/files-1757868630683-52261917.jpg +0 -0
- package/public/uploads1/files-1757869187061-619427683.jpg +0 -0
- package/public/uploads1/small_files-1757869187061-619427683.jpg +0 -0
- package/public/uploads1//346/265/213/350/257/225/347/224/250upload +0 -0
- package/public/utils.html +57 -0
- package/public/utils.js +161 -0
- package/public/webrtc/rtc-client.html +238 -0
- package/public/webrtc/rtc-file-transfer-client.html +238 -0
- package/public/webrtc/rtc-file-transfer-server.html +453 -0
- package/public/webrtc/rtc-server.html +453 -0
- package/public/webrtc/video-client-input.html +264 -0
- package/public/webrtc/video-server-input.html +312 -0
- package/public/webrtc/webrtc-chat-with-files.html +581 -0
- package/public/webrtc/webrtc-chat.html +367 -0
- package/public/webrtc/webrtc-file-offer.html +88 -0
- package/public/webrtc/webrtc1.html +186 -0
- package/readme.txt +71 -0
- package/views/chat.ejs +53 -0
- package/views/index.ejs +125 -0
- package/views/special-message.ejs +8 -0
- package/views/ssh.ejs +142 -0
- package/views/utils.ejs +0 -0
- package/views/webrtc/client.ejs +203 -0
- package/views/webrtc/server.ejs +365 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
|
|
6
|
+
<meta charset="utf-8">
|
|
7
|
+
<meta name="description" content="WebRTC code samples">
|
|
8
|
+
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1, maximum-scale=1">
|
|
9
|
+
<meta itemprop="description" content="Client-side WebRTC code samples">
|
|
10
|
+
<meta itemprop="image" content="../../../images/webrtc-icon-192x192.png">
|
|
11
|
+
<meta itemprop="name" content="WebRTC code samples">
|
|
12
|
+
<meta name="mobile-web-app-capable" content="yes">
|
|
13
|
+
<meta id="theme-color" name="theme-color" content="#ffffff">
|
|
14
|
+
|
|
15
|
+
<base target="_blank">
|
|
16
|
+
|
|
17
|
+
<title>Video to peer connection</title>
|
|
18
|
+
|
|
19
|
+
<!--link rel="icon" sizes="192x192" href="../../../images/webrtc-icon-192x192.png">
|
|
20
|
+
<link href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet" type="text/css">
|
|
21
|
+
<link rel="stylesheet" href="../../../css/main.css" />
|
|
22
|
+
<link rel="stylesheet" href="css/main.css" /-->
|
|
23
|
+
<script src="/js/socket.io.min.js"></script>
|
|
24
|
+
</head>
|
|
25
|
+
|
|
26
|
+
<body>
|
|
27
|
+
|
|
28
|
+
<div id="container">
|
|
29
|
+
|
|
30
|
+
<h1><a href="/"><span>SERVER</span></a></h1>
|
|
31
|
+
|
|
32
|
+
<video id="leftVideo" controls muted crossorigin="anonymous">
|
|
33
|
+
<!-- NB CORS: https://bugzilla.mozilla.org/show_bug.cgi?id=1177793 -->
|
|
34
|
+
<source src="http://git.my.host:28888/200_pages1/mnt/disk2/sd2.3.2.mp4" type="video/mp4" />
|
|
35
|
+
<source src="http://git.my.host:28888/200_pages1/mnt/disk2/sd2.3.1.mp4" type="video/mp4" />
|
|
36
|
+
<p>This browser does not support the video element.</p>
|
|
37
|
+
</video>
|
|
38
|
+
<p>获取stun/turn回掉</p>
|
|
39
|
+
<div>
|
|
40
|
+
使用方法:
|
|
41
|
+
两处分别打开server/client, 服务器端分别点击init/call, 就能实现视频的同步播放。
|
|
42
|
+
</div>
|
|
43
|
+
<button onclick="init()">初始化PeerConnect</button>
|
|
44
|
+
<p>建立offer</p>
|
|
45
|
+
<button onclick="call()">发起请求</button>
|
|
46
|
+
<!--button>播放</button-->
|
|
47
|
+
|
|
48
|
+
<!--video id="rightVideo" autoplay controls></video-->
|
|
49
|
+
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<script>
|
|
53
|
+
|
|
54
|
+
/*
|
|
55
|
+
server:82 Uncaught SecurityError: Failed to execute 'captureStream' on 'HTMLMediaElement': Cannot capture from element with cross-origin data
|
|
56
|
+
at HTMLVideoElement.maybeCreateStream (server:82:24)
|
|
57
|
+
引用第三方站点的视频
|
|
58
|
+
video元素加上属性crossorigin="anonymous"
|
|
59
|
+
git.my.host站点上的视频,通过如何配置实现了确认跨站为crossorigin="anonymous"?
|
|
60
|
+
视频流的转发似乎是无法捕捉的,看不到流体数据的,不同于(不通过)websocket/http的
|
|
61
|
+
通过socket.io实现点对点的“握手”
|
|
62
|
+
*/
|
|
63
|
+
'use strict';
|
|
64
|
+
let socket;
|
|
65
|
+
//window.onload = function() {
|
|
66
|
+
socket = io();
|
|
67
|
+
const hostId = new Date().getTime();
|
|
68
|
+
/*
|
|
69
|
+
{
|
|
70
|
+
"0": "zVO3vR9I1Vs9cfX1AAAL"
|
|
71
|
+
}*/
|
|
72
|
+
//socket.onconnect = function(){ console.log(arguments) }
|
|
73
|
+
/*
|
|
74
|
+
get description from server
|
|
75
|
+
*/
|
|
76
|
+
socket.on('webrtc ice-candidate', function( msg ) {
|
|
77
|
+
//socket.emit('ice-candidate', { host:hostId, candidate: event.candidate})
|
|
78
|
+
//msg.candidate
|
|
79
|
+
if( msg.host != hostId ){
|
|
80
|
+
//pc1.addIceCandidate( msg.candidate )
|
|
81
|
+
(pc1).addIceCandidate(msg.candidate)
|
|
82
|
+
.then(()=>{
|
|
83
|
+
console.log('addIceCandidate success', msg.candidate )
|
|
84
|
+
})
|
|
85
|
+
.catch(function(err) {
|
|
86
|
+
console.error('Error adding candidate:' + err )
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
console.log(msg)
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// server create offer, so ignore?
|
|
93
|
+
// add desc immediately, not from server
|
|
94
|
+
// 那些socket.io的通道, 发送object
|
|
95
|
+
// client能够播放的前提是什么?
|
|
96
|
+
socket.on('webrtc offer', function(msg) {
|
|
97
|
+
console.log(msg)
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
/*
|
|
101
|
+
事件
|
|
102
|
+
装入video, metadata
|
|
103
|
+
收到ice反馈
|
|
104
|
+
收到客户端ice反馈
|
|
105
|
+
*/
|
|
106
|
+
socket.on('webrtc answer', function(desc) {
|
|
107
|
+
console.log('got answer')
|
|
108
|
+
pc1.setRemoteDescription(desc, function() {
|
|
109
|
+
console.log('!!!!!!setRemoteDescription ok');
|
|
110
|
+
}, (error)=> console.log('Failed to set session description: ' + error.toString()) );
|
|
111
|
+
//pc1.setRemoteDescription(desc)
|
|
112
|
+
console.log(desc)
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
var leftVideo = document.getElementById('leftVideo');
|
|
116
|
+
//var rightVideo = document.getElementById('rightVideo');
|
|
117
|
+
|
|
118
|
+
var stream;
|
|
119
|
+
|
|
120
|
+
var pc1;
|
|
121
|
+
//var pc2;
|
|
122
|
+
var offerOptions = {
|
|
123
|
+
offerToReceiveAudio: 1,
|
|
124
|
+
offerToReceiveVideo: 1
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
var startTime;
|
|
128
|
+
|
|
129
|
+
function maybeCreateStream() {
|
|
130
|
+
if (stream) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (leftVideo.captureStream) {
|
|
134
|
+
// 从video里获取流?媒体流
|
|
135
|
+
stream = leftVideo.captureStream();
|
|
136
|
+
console.log('Captured stream from leftVideo with captureStream',
|
|
137
|
+
stream);
|
|
138
|
+
//call();
|
|
139
|
+
} else if (leftVideo.mozCaptureStream) {
|
|
140
|
+
stream = leftVideo.mozCaptureStream();
|
|
141
|
+
console.log('Captured stream from leftVideo with mozCaptureStream()',
|
|
142
|
+
stream);
|
|
143
|
+
//call();
|
|
144
|
+
} else {
|
|
145
|
+
console.error('captureStream() not supported');
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Video tag capture must be set up after video tracks are enumerated.
|
|
150
|
+
//leftVideo.oncanplay = maybeCreateStream;
|
|
151
|
+
if (leftVideo.readyState >= 3) { // HAVE_FUTURE_DATA
|
|
152
|
+
// Video is already ready to play, call maybeCreateStream in case oncanplay
|
|
153
|
+
// fired before we registered the event handler.
|
|
154
|
+
//maybeCreateStream();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
//leftVideo.play();
|
|
158
|
+
|
|
159
|
+
function init(){
|
|
160
|
+
maybeCreateStream();
|
|
161
|
+
startTime = window.performance.now();
|
|
162
|
+
var videoTracks = stream.getVideoTracks();
|
|
163
|
+
var audioTracks = stream.getAudioTracks();
|
|
164
|
+
if (videoTracks.length > 0) {
|
|
165
|
+
console.log('Using video device: ' + videoTracks[0].label);
|
|
166
|
+
}
|
|
167
|
+
if (audioTracks.length > 0) {
|
|
168
|
+
console.log('Using audio device: ' + audioTracks[0].label);
|
|
169
|
+
}
|
|
170
|
+
//var servers = null;
|
|
171
|
+
const configuration = {
|
|
172
|
+
iceServers: [
|
|
173
|
+
//stun协议服务器。反馈外网信息
|
|
174
|
+
{ urls: 'stun:stun.l.google.com:19302' },
|
|
175
|
+
/*
|
|
176
|
+
{
|
|
177
|
+
urls: 'turn:yourturnserver.com:3478',
|
|
178
|
+
username: 'yourusername',
|
|
179
|
+
credential: 'yourpassword'
|
|
180
|
+
}*/
|
|
181
|
+
]
|
|
182
|
+
};
|
|
183
|
+
pc1 = new RTCPeerConnection(configuration);
|
|
184
|
+
//console.log('Created local peer connection object pc1');
|
|
185
|
+
pc1.onicecandidate = function(e) {
|
|
186
|
+
//addIceCandidate
|
|
187
|
+
/*
|
|
188
|
+
// 首先发送ice-candidate的是客户端?
|
|
189
|
+
*/
|
|
190
|
+
socket.emit('webrtc ice-candidate', { host: hostId, candidate: (event.candidate) });
|
|
191
|
+
};
|
|
192
|
+
pc1.oniceconnectionstatechange = function(e) {
|
|
193
|
+
//onIceStateChange(pc1, e);
|
|
194
|
+
console.log('ICE state change event: ', e);
|
|
195
|
+
return;
|
|
196
|
+
//
|
|
197
|
+
e.target
|
|
198
|
+
e.currentTarget
|
|
199
|
+
const currentState = e.target.iceConnectionState;
|
|
200
|
+
console.log('ICE 连接状态变化:', currentState);
|
|
201
|
+
|
|
202
|
+
// 根据不同状态处理
|
|
203
|
+
switch (currentState) {
|
|
204
|
+
case 'new':
|
|
205
|
+
// 初始状态:连接尚未开始建立
|
|
206
|
+
console.log('ICE 连接已创建,尚未开始连接');
|
|
207
|
+
break;
|
|
208
|
+
case 'checking':
|
|
209
|
+
// 正在检查连接:ICE 正在尝试不同的候选地址(如本地地址、STUN 反射地址、TURN 中继地址)
|
|
210
|
+
console.log('ICE 正在检查连接候选地址...');
|
|
211
|
+
break;
|
|
212
|
+
case 'connected':
|
|
213
|
+
// 部分连接成功:至少有一个 P2P 连接已建立(可能仍在检查其他候选以优化连接)
|
|
214
|
+
console.log('ICE 已建立部分连接,通信可正常进行');
|
|
215
|
+
break;
|
|
216
|
+
case 'completed':
|
|
217
|
+
// 完全连接成功:所有 ICE 候选检查完成,最佳 P2P 连接已确定
|
|
218
|
+
console.log('ICE 连接完全建立,已确定最佳通信路径');
|
|
219
|
+
break;
|
|
220
|
+
case 'failed':
|
|
221
|
+
// 连接失败:所有 ICE 候选检查都失败,P2P 连接无法建立(需考虑用 TURN 中继或提示用户)
|
|
222
|
+
console.error('ICE 连接失败,无法建立 P2P 通信');
|
|
223
|
+
// 可选:触发重试逻辑或提示用户
|
|
224
|
+
retryConnection();
|
|
225
|
+
break;
|
|
226
|
+
case 'disconnected':
|
|
227
|
+
// 连接断开:之前建立的连接丢失(如网络波动、对方离线)
|
|
228
|
+
console.warn('ICE 连接已断开,尝试重连...');
|
|
229
|
+
// 可选:尝试重新收集 ICE 候选并重连
|
|
230
|
+
//peerConnection.restartIce();
|
|
231
|
+
console.error('ICE 连接失败,尝试重启...');
|
|
232
|
+
// 重启 ICE 流程(会重新收集候选并尝试连接)
|
|
233
|
+
peerConnection.restartIce()
|
|
234
|
+
.then(() => console.log('ICE 重启成功,正在重新连接...'))
|
|
235
|
+
.catch(err => console.error('ICE 重启失败:', err));
|
|
236
|
+
break;
|
|
237
|
+
case 'closed':
|
|
238
|
+
// 连接已关闭:主动调用 peerConnection.close() 后触发
|
|
239
|
+
console.log('ICE 连接已主动关闭');
|
|
240
|
+
// 可选:释放资源、清理 UI
|
|
241
|
+
cleanupConnection();
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/*
|
|
248
|
+
console日志
|
|
249
|
+
# init
|
|
250
|
+
server:165 Using video device: 9b6cff8c-3e0a-46d8-b86d-fc86b0d73d4a
|
|
251
|
+
server:168 Using audio device: c8079d5a-e972-4d12-9c51-7e6c6e7821ef
|
|
252
|
+
# call
|
|
253
|
+
server:196 Starting call
|
|
254
|
+
server:197 Added local stream to pc1
|
|
255
|
+
server:207 pc1 createOffer start
|
|
256
|
+
server:216 Offer from pc1 ...
|
|
257
|
+
server:217 pc1 setLocalDescription start
|
|
258
|
+
server:220 !!!!!!SetLocalSuccess ok
|
|
259
|
+
server:107 got answer
|
|
260
|
+
server:112 {sdp: 'v=0\r\no=- 8739207882550025941 2 IN IP4 127.0.0.1\r\ns…\r\na=fmtp:120 apt=119\r\na=rtpmap:121 ulpfec/90000\r\n', type: 'answer'}
|
|
261
|
+
server:109 !!!!!!setRemoteDescription ok
|
|
262
|
+
server:191 ICE state change event: Event {isTrusted: true, type: 'iceconnectionstatechange', target: RTCPeerConnection, currentTarget: RTCPeerConnection, eventPhase: 2, …}
|
|
263
|
+
server:191 ICE state change event: Event {isTrusted: true, type: 'iceconnectionstatechange', target: RTCPeerConnection, currentTarget: RTCPeerConnection, eventPhase: 2, …}
|
|
264
|
+
server:89 {host: 1756610947279, candidate: {…}}
|
|
265
|
+
server:83 addIceCandidate success {candidate: 'candidate:2256197101 1 udp 2113937151 1b1bb5ba-bd1…typ host generation 0 ufrag cSNk network-cost 999', sdpMid: '0', sdpMLineIndex: 0, usernameFragment: 'cSNk'}
|
|
266
|
+
server:89 {host: 1756610947279, candidate: {…}}
|
|
267
|
+
server:83 addIceCandidate success {candidate: 'candidate:2536228356 1 udp 2113939711 c72f1926-593…typ host generation 0 ufrag cSNk network-cost 999', sdpMid: '0', sdpMLineIndex: 0, usernameFragment: 'cSNk'}
|
|
268
|
+
server:89 {host: 1756610947279, candidate: null}
|
|
269
|
+
server:83 addIceCandidate success null
|
|
270
|
+
*/
|
|
271
|
+
function call() {
|
|
272
|
+
console.log('Starting call');
|
|
273
|
+
console.log('Added local stream to pc1');
|
|
274
|
+
//注入音视频流
|
|
275
|
+
stream.getTracks().forEach(
|
|
276
|
+
function(track) {
|
|
277
|
+
pc1.addTrack(
|
|
278
|
+
track,
|
|
279
|
+
stream
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
);
|
|
283
|
+
console.log('pc1 createOffer start');
|
|
284
|
+
//竟然需要等待createOffer发起后,才发起ice请求
|
|
285
|
+
/*
|
|
286
|
+
pc1.onicecandidate
|
|
287
|
+
本地产生onicecandidate事件, 客户端收到webrtc ice-candidate事件
|
|
288
|
+
发送offer信息
|
|
289
|
+
建立offer竟然是异步,通过回调获得终结的事件
|
|
290
|
+
建立offer就会输出输出offer信息, 格式信息
|
|
291
|
+
触发: pc1.onicecandidate = function(e) {
|
|
292
|
+
无需client/answer页的开启
|
|
293
|
+
多个webrtc可以接收一个视频源?
|
|
294
|
+
ws.emit, 通过ws获得offer/candidate信息都可以接受一个视频源?
|
|
295
|
+
"createOffer,多个端接收,可以吗"
|
|
296
|
+
RTCPeerConnection 是 点对点 的连接对象,一次 createOffer() 生成的 SDP 会话描述,只能与 一个远程端 的 setRemoteDescription() 配对。这是因为:
|
|
297
|
+
增加一个ws收集消息的容器,如textarea,都是通过ws转发过来的信息, 设置策略: 转发/广播/反馈
|
|
298
|
+
*/
|
|
299
|
+
pc1.createOffer(onCreateOfferSuccess,
|
|
300
|
+
( error )=>console.log('Failed to create session description: '
|
|
301
|
+
+ error.toString()),
|
|
302
|
+
offerOptions);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
//createOffer
|
|
306
|
+
function onCreateOfferSuccess(desc) {
|
|
307
|
+
console.log('Offer from pc1\n' + desc.sdp);
|
|
308
|
+
console.log('pc1 setLocalDescription start');
|
|
309
|
+
pc1.setLocalDescription(desc, function() {
|
|
310
|
+
//
|
|
311
|
+
console.log( "!!!!!!SetLocalSuccess ok" );
|
|
312
|
+
}, (err)=>{
|
|
313
|
+
console.error( "SetLocalFailed", err );
|
|
314
|
+
});
|
|
315
|
+
// 发送offer信息
|
|
316
|
+
socket.emit( 'webrtc offer', desc );
|
|
317
|
+
/*
|
|
318
|
+
本机中,pc1.CreateOffer获得描述后,马上让pc2加上
|
|
319
|
+
不同主机上,需要通过websocket获得desc
|
|
320
|
+
console.log('pc2 setRemoteDescription start');
|
|
321
|
+
pc2.setRemoteDescription(desc, function() {
|
|
322
|
+
onSetRemoteSuccess(pc2);
|
|
323
|
+
}, onSetSessionDescriptionError);
|
|
324
|
+
console.log('pc2 createAnswer start');
|
|
325
|
+
// Since the 'remote' side has no media stream we need
|
|
326
|
+
// to pass in the right constraints in order for it to
|
|
327
|
+
// accept the incoming offer of audio and video.
|
|
328
|
+
pc2.createAnswer(onCreateAnswerSuccess, onCreateSessionDescriptionError);
|
|
329
|
+
*/
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/*
|
|
333
|
+
这是从stun/turn获得信息,转发注册到本地服务器上
|
|
334
|
+
部署到aliyun,然后在两个子网测试视频的传送
|
|
335
|
+
*/
|
|
336
|
+
function onIceCandidate(pc, event) {
|
|
337
|
+
//getOtherPc(pc).addIceCandidate(event.candidate)
|
|
338
|
+
console.log( "onIceCandidate", event.candidate )
|
|
339
|
+
/*
|
|
340
|
+
event.candidate.candidate:string
|
|
341
|
+
{
|
|
342
|
+
"candidate": "candidate:169729363 1 udp 1677729535 112.0.164.82 8880 typ srflx raddr 0.0.0.0 rport 0 generation 0 ufrag bHc2 network-cost 999",
|
|
343
|
+
"sdpMid": "0",
|
|
344
|
+
"sdpMLineIndex": 0,
|
|
345
|
+
"usernameFragment": "bHc2"
|
|
346
|
+
}
|
|
347
|
+
emit后的对象只剩这些
|
|
348
|
+
*/
|
|
349
|
+
//console.log()
|
|
350
|
+
/*
|
|
351
|
+
chat.ejs的socket.emit靠谱。而这里服务器上没有产生message日志
|
|
352
|
+
message: ;;;;;;;;;;
|
|
353
|
+
//socket.emit('chat message', "input.value")
|
|
354
|
+
*/
|
|
355
|
+
|
|
356
|
+
//console.log(getName(pc) + ' ICE candidate: \n' + (event.candidate ?
|
|
357
|
+
// event.candidate.candidate : '(null)'));
|
|
358
|
+
}
|
|
359
|
+
//};
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
</script>
|
|
363
|
+
|
|
364
|
+
</body>
|
|
365
|
+
</html>
|