I want to be able to do realtime updates of my webix components using socket.io instead of faye. We saw a comment on the initial blog posting for faye that suggested we add a new proxy, webix.proxy.socketio in webix_debug.js. I did this and and the method looks identical to the faye proxy except instead of this.client.subscribe and this.client.publish, i’m using this.socket.on and this.socket.emit. In the html file, i’m initializing the socket as follows:
webix.proxy.socketio.socket = io.connect(‘http://localhost:3002’);
Also, something important to note is that my node.js server which serves the html file is running on port 3001 (via an express route) and the realtime socket runs on port 3002.
Problem 1: What’s happening is that when the code gets to webix.proxy function, it attempts to make a copy and goes into infinite recursions and eventually crashes. I’m not sure why this is happening.
As a temporary fix, i wanted to see what would happen if instead of making a copy, i just called source.init and returned source in the webix.proxy function. That lead to…
Problem 2:
I notice that there is a get request going out on localhost:3001/data. I believe it’s because of the line url: “socketio->/data” in my webix.ui component. However i don’t know why this request is going out because i established the socket on 3002 and i don’t think anything should be sending out a get request. Or should there be something returned from localhost:3001/data that’s needed?
I would really appreciate some guidance on what’s going on here and what i can do to use socket.io.
Thank You,
Jas