Git Product home page Git Product logo

Comments (6)

adzialocha avatar adzialocha commented on July 17, 2024

Hi @jarmitage! :-) This is hard to tell, since it might also be related to your network configuration and backend. Did you try using ip address 0.0.0.0?

from osc-js.

triceratupuz avatar triceratupuz commented on July 17, 2024

Hi, have same problem with this trivial example:

const plugin = new OSC.WebsocketBrowserPlugin({ port: 19912 }) const osc = new OSC( { discardLateMessages: false, plugin: plugin }); osc.open({ host: '127.0.0.1' }); function activator(id) { var message = new OSC.Message('/test/random', Math.random()); osc.send(message); }

tried also 0.0.0.0 with same results. Is there anything i could check?

from osc-js.

adzialocha avatar adzialocha commented on July 17, 2024

@triceratupuz do you have more information regarding your setup / server implementation?

from osc-js.

triceratupuz avatar triceratupuz commented on July 17, 2024

By further reading the docs/examples seems that what i'd like to do is not possible but I'll explain anyhow:
On the same computer I'd like to send messages from the browser (running the script above) to an audio program (csound). I'm currently not using csound but a software to monitor osc messages.
Could you confirm that an additional server is required?

from osc-js.

adzialocha avatar adzialocha commented on July 17, 2024

@triceratupuz in most of the cases you might need a bridging server in the middle to translate from websocket (browser) to udp / tcp protocols, in this sense you are right that it might not work as you planned it.

But it also looks like csound offers a websocket library (http://www.csounds.com/manual/html/websocket.html), maybe you try using this one to talk to the browser?

from osc-js.

gilfuser avatar gilfuser commented on July 17, 2024

Hi.
For the about the same reasons than @jarmitage I'm trying to implement osc-js in an node.js app, and I'm getting the same results.
I'm trying to build an app using Webrtc with which people can get and send streams of OSC to use with SuperCollider, Pd, OpenFrameworks, etc.

I haven't linked the osc part with the webrtc, which is working.
When I test it locally the OSC msgs go fine between the browser and SC, but when I deploy the app I get the same errors from jarmitage, both in Firefox and Chrome.
I tried to use the options like so in the node server.js:

const oscoptions = {
  receiver: 'ws', // @param {string} Where messages sent via 'send' method will be delivered to, 'ws' for Websocket clients, 'udp' for udp client
  udpServer: { port: 54321 },
  udpClient: { port: 57120 },
  wsServer: {
    host: '0.0.0.0', // @param {string} Hostname of WebSocket server
    port: 8080, // @param {number} Port of WebSocket server
  },
};
const osc = new OSC({ plugin: new OSC.BridgePlugin(oscoptions) });
osc.on('/hello', (message) => {
  console.log(message.args);
});
osc.open(); // start a WebSocket server on port 8080

and so in the app itself:

const options = {
  udpServer: { port: 54321 },
  udpClient: { port: 57120 },
  wsServer: {
    host: '0.0.0.0', // @param {string} Hostname of WebSocket server
    port: 8080, // @param {number} Port of WebSocket server
  },
  wsClient: {
    host: '0.0.0.0',
    port: 8080,
  },
};

let osc = new OSC(options);
osc.open(); // connect by default to ws://localhost:8080

document.getElementById('send-osc').addEventListener('click', () => {
  let message = new OSC.Message('/test/random', Math.random());
  osc.send(message);
});

I'm doing it from home, so there is no firewall-fancy-stuff here.
If there is any information I could give to circumvent what is causing the problem, please let me know.

best regards,
Gil

from osc-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.