CORS restrictions with Arduino Create Agent (custom webpage to read serial)

Hello,

I’m trying to read serial data from an Arduino connected to a machine, locally. I have been using this tool to do so until now: https://github.com/DecodedCo/ArduinoProxy but want a web-based version.

Using the binary version of https://github.com/arduino/arduino-create-agent on Mac OS X, I’m trying to access the websocket interface, and failing due to CORS (or lack of).

<!DOCTYPE html>
<html>
<head>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.1/socket.io.js"></script>
  <script type="text/javascript">
    var socket = io('http://localhost:8991/');

    socket.on('connect', function(){
      console.log(socket.id);
    });
  </script>
</head>
<body>

</body>
</html>

which returns

XMLHttpRequest cannot load http://localhost:8991/socket.io/?EIO=3&transport=polling&t=Lmm_5aR. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.

Which is odd, as there are various CORS headers defined in the codebase (arduino create etc).

The agent is listening on that port (visiting http://localhost:8991 returns a functioning debug console).

Am I missing something?

Thanks,

Amadeus

This looks relevant: