Reply To: Using node server across domains

About Forums Forum Using node server across domains Reply To: Using node server across domains

#961

Hi Emma,

Your project sounds cool. Another person mentioned the issue of Breakout Server not working when the window loses focus. Are you running OS X 10.9?

Regarding the CORS issue. What IP address you’re passing to the IOBoard constructor in your code?

If you’re using the following block of code:

    var host = window.location.hostname;
    // if the file is opened locally, set the host to "localhost"
    if (window.location.protocol.indexOf("file:") === 0) {
        host = "localhost";
    }
    var arduino = new IOBoard(host, 8887);

you need to change host in the IOBoard constructor to either “localhost” or the specific IP address of the computer the node server is running on. Otherwise by default host points to the content server (the wordpress site).

Let me know if that fixes the issue for you. I may also need to add a flag to the node server to disable the ability to serve pages… leaving just the websocket bridge in that case (this is what I was getting at in my tweet… not a lot of room to reply in twitter though so thanks for posting here).