@@ -244,6 +244,7 @@ wss.on('connection', (client: WebSocket, request: IncomingMessage) => {
244
244
console . log ( `New Connection - ${ clientId } ` ) ;
245
245
246
246
if ( ! clientId . includes ( ':proof' ) ) {
247
+ console . log ( 'proof connection' , clientId ) ;
247
248
client . send (
248
249
bufferify ( {
249
250
method : 'client_connect' ,
@@ -264,6 +265,7 @@ wss.on('connection', (client: WebSocket, request: IncomingMessage) => {
264
265
if ( pair ) {
265
266
pairs . delete ( pair ) ;
266
267
pairs . delete ( clientId ) ;
268
+ console . log ( 'disconnect' , clientId ) ;
267
269
await send (
268
270
pair ,
269
271
bufferify ( {
@@ -285,7 +287,10 @@ wss.on('connection', (client: WebSocket, request: IncomingMessage) => {
285
287
const [ cid ] = clientId . split ( ':' ) ;
286
288
const pairedClientId = pairs . get ( cid ) ;
287
289
// @ts -ignore
288
- console . log ( 'mpc' , rawData . length ) ;
290
+ console . log ( 'mpc' , rawData . length , {
291
+ from : clientId ,
292
+ to : pairedClientId + ':proof' ,
293
+ } ) ;
289
294
await send ( pairedClientId + ':proof' , rawData ) ;
290
295
return ;
291
296
}
@@ -314,11 +319,11 @@ wss.on('connection', (client: WebSocket, request: IncomingMessage) => {
314
319
case 'proof_request_cancel' :
315
320
case 'proof_request_reject' :
316
321
case 'proof_request_end' :
317
- console . log ( msg . method ) ;
322
+ console . log ( msg . method , { from : clientId , to } ) ;
318
323
await send ( to , rawData ) ;
319
324
break ;
320
325
case 'pair_request_success' : {
321
- console . log ( msg . method ) ;
326
+ console . log ( msg . method , { from : clientId , to } ) ;
322
327
if ( await send ( to , rawData ) ) {
323
328
pairs . set ( to , clientId ) ;
324
329
pairs . set ( clientId , to ) ;
0 commit comments