My question is not about the construct.
I want to make a simple and (independent of the construct) web chat using websocket (by which two devices connected to the same Wi-Fi can communicate locally)
I searched on Google.
I made a local server named server.js.
And also an html file for the client.
Through the cmd window and the command:
node server.js,
I ran app server and I was able to successfully connect the client to it.
But I plan to also run the server.js file in the browser (html file).
But when I run its codes by html.
gives an error that:
require ws(web socket) undefined
I think the requier doesn't run in the browser. How do I solve it?