mirror of
https://github.com/xtr-dev/rondevu-demo.git
synced 2025-12-15 12:33:23 +00:00
Add delay and more debugging to identify message sending
This commit is contained in:
@@ -91,13 +91,20 @@ async function main() {
|
|||||||
|
|
||||||
dc.onopen = () => {
|
dc.onopen = () => {
|
||||||
console.log(' ✓ Data channel opened!')
|
console.log(' ✓ Data channel opened!')
|
||||||
|
console.log(` Data channel state: ${dc.readyState}`)
|
||||||
|
|
||||||
// Send identify message (demo protocol)
|
// Small delay to ensure both sides are ready
|
||||||
console.log(`📤 Sending identify message...`)
|
setTimeout(() => {
|
||||||
dc.send(JSON.stringify({
|
// Send identify message (demo protocol)
|
||||||
type: 'identify',
|
console.log(`📤 Sending identify message...`)
|
||||||
from: rondevu.getUsername()
|
const identifyMsg = JSON.stringify({
|
||||||
}))
|
type: 'identify',
|
||||||
|
from: rondevu.getUsername()
|
||||||
|
})
|
||||||
|
console.log(` Message:`, identifyMsg)
|
||||||
|
dc.send(identifyMsg)
|
||||||
|
console.log(` ✓ Identify message sent`)
|
||||||
|
}, 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
dc.onmessage = (event) => {
|
dc.onmessage = (event) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user