Connecting players via p2p(android) as game joysticks

Hello. I have a couple of questions, general and specific. Sorry if I couldn’t google the answers.

  1. There is a rather interesting game - “Mad Men” I really liked the idea of ​​​​playing on the console (but now of course we are talking about the PC) but control the characters using the phone, which acts as a joystick. The question is - is it possible to create a multiplayer game p2p scene will be created by a PC, and mobile phones will be connected like joysticks, in 1 wifi network
  2. If there is such an opportunity, is it possible to make the id shorter … I understand that everything depends on javascript, that is, technically there is no way to make a common room, so to speak, in which all those connected to the internal network would be displayed.

Sorry for the confusion.