A web page with two buttons & a display for controlling Max

Julien Bayle's icon

Hi there,
I just dived into NodeJS for Max.
This is really amazing.

I'm looking for the best strategy for controlling and getting feedback from Max.
Basically, I'd like to build a small prototype with 2 buttons and a numerical values.

I checked the routeServer example.
This is very useful : I got 2 links (not button but proper html links) and when I click, I do something in Max. Totally Ok

BUT for the opposite way, getting feedback from Max, it is not easy for me.
I thought about http-refresh, something where the web client would poll Max. NOT efficient at all but...
Of course, I was thinking about XMLHttpRequest or something like that.

Would you have an example around this concept ?
I'd be really happy to check this out.

Julien Bayle's icon

github's sockets example show this sockets way.
this is amazing.

I'm just struggling "merging" sockets and routeServer examples for having :
- buttons for triggering actions from webpage to Max
- values refreshing on the webpage when they change in Max