How can I do lan networking with JS



  • As soon as that bug that doesn’t let me click anything is gotten rid of, I want to make a quiz game.
    I want to do it on the lan using JS. How can I do this.
    I want to know how to:
    *open a udp server so clients can find it.
    *connect to the clients(preferably with sockets)
    *send/receive Info.

    Do you know how to do this?



  • Can I do this with JS @soywiz?



  • JS only supports websockets that are http-tcp-based, so server is needed, and no udp (or raw tcp) is possible with JS. This is mostly related to security.

    The only peer to peer api Im aware of is WebRTC. But unless i missed something and as far as I remember when I tried it for my web based psp emulator, still a server was needed for discovery between peers, so no real local multiplayer afaik.

    Typically you would create a websocket server online and maybe you could use the public ip to know that your clients are likely to be in a lan. But that would still require an internet connection and maybe you don't want that