I have been written an app in vue-native for sending messages to touchdesigner through sockets. My app is using sockets.io.
I am successfully sending messages from my client app to a node server but I cannot seem to connect with TD using the TCPIP DAT.
Anyone successfully have connect to TD this way? Or another way using Vue-native or React native?
Some more code details:
From my app I am just emiting the message from with:
mounted() {
const socket = io("http://192.168.43.54:3000");
socket.emit("chat message", "Hello world!")
and receiving it with this function in my node express server:
io.on("connection", socket => {
console.log("a user connected :D");
socket.on("chat message", msg => {
console.log(msg);
});
});
did you try the “websocket” DAT yet?
** can a mod move this to the “beginners” forum
yes I have already tried with websocket DAT using 192.168.43.54 as network adress and with port 3000 as on my client but I get no response there.
I have now solved this by sending messages from my client app to the node server where I forward the message as OSC which I am receiving in TD.
But I think it should be a better and more direct way of doing this?
I actually usually do it this way. I don’t use the websockets in TD instead prefer to use UDP messaging because it’s less error prone.
I write an interpreter in Node that takes control of sockets. NPM will always be more up to date with current SOCKET-IO protocols vs Touch.
The node app packages messages from front-end and sends to TD.
You can also go the other direction just as easily.
I might stick to that solution.
Thanks for your input!
I’ve had success with WebSocket but not socket.io
const WebSocket = require("ws");
const wss = new WebSocket.Server({ port: 8000});
wss.on("connection", function connection(ws) {
console.log('client connected');
}