NodeJs string transferring via web socket
LLRL
Sep 22 2023 | 9:35 am
Hello,
I want to use WebSockets to send messages to a web page,
today I used Node.js for the first time in Max.
I referred to this example:
https://github.com/Cycling74/n4m-examples/blob/master/sockets/max_sockets.js
which allows me to send three values to the web page. However, I'm not sure how to modify the program to send three strings instead of three numbers. I have been trying for a whole day, but whenever I send a 3-string group message from Max, the web page always displays "NaN" (Not a number).
I am trying to modify this part :
Max.addHandler("send", (...args) => {
console.log("send args: " + args);
if (args.length === 3) {
sender(args[0], args[1], args[2]);
}
But still I couldn't find out the right way...
Can you please tell me how to modify the program to achieve this?
Thank you!