Hello,
I am currently trying to create a web page for Mopidy with socket.io, but I’m stuck a this point. Currently when I load the page, I got this error :
Firefox can't establish a connection to the server at ws://localhost:6680/mopidy/ws/.
WebSocket error: error { target: WebSocket, isTrusted: true, currentTarget: WebSocket, eventPhase: 2, bubbles: false, cancelable: false, defaultPrevented: false, composed: false, timeStamp: 1491557237568000, cancelBubble: false, originalTarget: WebSocket }
Here is the file that I launch from node :
var express = require('express');
var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var Mopidy = require('mopidy');
var mopidy = new Mopidy({
webSocketUrl: "ws://localhost:6680/mopidy/ws/"
});
app.use("/", express.static(__dirname + "/"));
http.listen(8080);
console.log('Server running on port 8080');
But I think this is not the problem as, when I start Node, Mopidy write on the console :
DEBUG 2017-04-07 09:26:48,791 [1108:HttpServer] mopidy.http.handlers
New WebSocket connection from 127.0.0.1
DEBUG 2017-04-07 09:26:48,822 [1108:HttpServer] mopidy.http.handlers
Received WebSocket message from 127.0.0.1: u'{"method":"core.describe","jsonrpc":"2.0","id":0}'
So node is well connected to mopidy I guess. But the problem seem to come from the controller.js, but i dont know how to solve that.
What could be the cause ?
English isn’t my first language, so please excuse any mistakes
Thanks if you have take time to read me