File tree Expand file tree Collapse file tree 3 files changed +16
-12
lines changed
Expand file tree Collapse file tree 3 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 99 } ,
1010
1111 message ( peer , message ) {
12- console . log ( "[ws] message" , peer , message ) ;
12+ console . log ( "[ws] message" , message ) ;
1313 if ( message . text ( ) . includes ( "ping" ) ) {
1414 peer . send ( { user : "server" , message : "pong" } ) ;
1515 } else {
Original file line number Diff line number Diff line change @@ -196,7 +196,13 @@ export class Message implements Partial<MessageEvent> {
196196 return this . text ( ) ;
197197 }
198198
199- [ kNodeInspect ] ( ) : { data : unknown } {
200- return { data : this . rawData } ;
199+ [ kNodeInspect ] ( ) : unknown {
200+ return {
201+ message : {
202+ id : this . id ,
203+ peer : this . peer ,
204+ text : this . text ( ) ,
205+ } ,
206+ } ;
201207 }
202208}
Original file line number Diff line number Diff line change @@ -117,15 +117,13 @@ export abstract class Peer<Internal extends AdapterInternal = AdapterInternal> {
117117 return "WebSocket" ;
118118 }
119119
120- [ kNodeInspect ] ( ) : Record < string , unknown > {
121- return Object . fromEntries (
122- [
123- [ "id" , this . id ] ,
124- [ "remoteAddress" , this . remoteAddress ] ,
125- [ "peers" , this . peers ] ,
126- [ "webSocket" , this . websocket ] ,
127- ] . filter ( ( p ) => p [ 1 ] ) ,
128- ) ;
120+ [ kNodeInspect ] ( ) : unknown {
121+ return {
122+ peer : {
123+ id : this . id ,
124+ ip : this . remoteAddress ,
125+ } ,
126+ } ;
129127 }
130128}
131129
You can’t perform that action at this time.
0 commit comments