Hi,
I try to start OSC server with multiple targets ( send field) and then redefine target in the OSC custom module (using /EDIT id target).
The command is correctly received by the widget (i see the changes by clicking edit the widget window but it continues to send to every targets setted in the send fiel at the boot.
I also tried to add a null argument in the target list but it has no effect.
Where I am wrong ?
Thk
The default targets defined in the server’s options are indeed always applied unless the widget’s target contains null
(the null
value, not the enquoted string "null"
).
If you need more control over the routing, you can filter outgoing messages with a custom module and define the target dynamicall from there.
For example, the following custom module would allow you to set a widget’s target
to custom:a
and redirect its message to 127.0.0.1:5555
var routing = {
"a" : ["127.0.0.1", 5555]
}
module.exports = {
oscOutFilter: function(data){
var {address, args, host, port} = data
if (host == 'custom' && routing[port]) {
[host, port] = routing[port]
}
return {address, args, host, port}
}
}
Ok thanks,
finally i decided to add some prefix on the address and filter it in the oscOutFilter and it works as well.