Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser UDP not communicated on remote computer #178

Open
KonVas opened this issue Jan 9, 2021 · 2 comments
Open

Browser UDP not communicated on remote computer #178

KonVas opened this issue Jan 9, 2021 · 2 comments

Comments

@KonVas
Copy link

KonVas commented Jan 9, 2021

I am working on a NodeJS/Express app.

I have this addresses below and while WebSocket works okay on the host machine, when running my app on another computer connected to the local network the message is not send to SC on its local SC of the remote computer, though is send to the host computer running Node/Server. That said, this is something I want, to get all OSC from all devices running the app but I would also think that the osc mesages are also bind to their local SC? Or I am missing out something trivial here.

Unless this is expected, I am speculating that I only receive the osc msgs because of the IP address in use below.

Client code

//OSC UDP-Browser Configuration
    oscPort = new osc.WebSocketPort({
        url: "ws://192.168.1.104:8081", 
> //tested with 127.0.0.1, and 0.0.0.0 throws "connection refused" error in both cases.
        metadata: true
    })

Server code

const osc = require('osc'),
      WebSocket = require('ws');

let udp = new osc.UDPPort({
        // This is the port we're listening on.
       localAddress: "0.0.0.0",
        localPort: 57121,
        // This is where sclang is listening for OSC messages.
        remoteAddress: "0.0.0.0",
        remotePort: 57120
    })

var wss = new WebSocket.Server({
    port: 8081
})

My server runs on 192.168.1.104:8000 if that makes any difference. For what's worth, I can receive the osc msg in all computers one way (SC - Browsers). I have checked for firewall or something else blocking on the corresponding computer but it's deactivated.

Thanks for all work it's fantastic, and the examples are very meticulously conducted.

@KonVas KonVas changed the title OSC not received on Remote Computer running on Node Browser UDP not communicated on remote computer Jan 9, 2021
@ahfontaine
Copy link

Hi KonVas, I am currently struggling with the same issue, did you ever find a solution to this problem?

@KonVas
Copy link
Author

KonVas commented Aug 23, 2021

I probably did, I was messing up the addresses in. Below is my working code:

let udp = new osc.UDPPort({

// This is the port we're listening on.
localAddress: "0.0.0.0",
localPort: 57121,

// This is where sclang is listening for OSC messages.
remoteAddress: "127.0.0.1",
remotePort: 57120
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants