I want every user to have a point representing their mouse, then ask the canvas to draw lines between users' points.
So i wonder if the drawing lines function is on the sever's side? Then how to write the Eventemitter?
I'm a beginner, so...please give detail if possible.
Many thanks.
No. Think of node.js as server-side technology, and your client-side approach would basically the same if you used Ruby, or Java, PHP, etc.
Drawing is client-side only, and you'd use something like canvas tag and API in client-side JS.
Hope this helps.
Oh and to your point about each user's mouse, what the node.js server would be responsible for is receiving the location from each user, and then sending these points to the clients. When each client receives these point updates, you redraw the canvas, etc in local javascript (again, not node js). This sounds like a good use-case for socket.io (based on WebSockets)