Just to clear up any misunderstanding, are you trying this on two laptops on your home network?
If so, you still need wifi for the connection between them, The cool thing about PeerJS is that the data goes directly between the computers (A <--> B) without a server in between (A <--> S <--> B).