2

I am creating a React Native application where users play a game in pairs. As soon as one user presses the play button on the menu screen, it looks for a room to join. If there are no rooms, it creates one. Would that be possible without NodeJS? Also is this question similar to this post: Socket.io managing rooms; allow 2 people per room, create new rooms dynamically

trill
  • 148
  • 2
  • 9
  • There needs to be a server (nodejs) for the sockets to work. I don't think peer to peer connections are possible with socketIO.You might have look at alternatives for peer to peer connections. – yaswanth Aug 27 '18 at 11:30
  • Could this work?: https://github.com/socketio/socket.io-p2p – trill Aug 27 '18 at 11:35
  • or this?: https://www.npmjs.com/package/react-native-multipeer – trill Aug 27 '18 at 11:44
  • At least with browser, this isn't possible.See https://stackoverflow.com/questions/4118272/do-websockets-allow-for-p2p-browser-to-browser-communication I'm not sure whether it's possible in react native, as the requests are not initiated/received from browser. – yaswanth Aug 27 '18 at 11:47
  • So its not possible to make an internal server on the mobile devices as well? – trill Aug 28 '18 at 02:31

0 Answers0