I have created a small script that has the purpose to listen to mopidy events and redirect them to a localhost php (laravel) webserver than can handle the events. Maybe I’m getting the whole thing completely wrong…
This is the script I wrote:
const Mopidy = require('mopidy');
var mopidy = new Mopidy();
Now, whenever I do npm start
and start my two line script I get a whole bunch of errors:
Mopidy.js is using the default calling convention. The default will change in the future. You should explicitly specify which calling convention you use.
WebSocket error: Event {
type: 'error',
message: 'Network error: ws://localhost/mopidy/ws: connect ECONNREFUSED 127.0.0.1:80',
bubbles: false,
cancelable: false,
currentTarget:
Client {
url: 'ws://localhost/mopidy/ws',
_driver:
Client {
version: 'hybi-13',
domain: null,
_events: [Object],
_eventsCount: 4,
_maxListeners: undefined,
_request: null,
_reader: [Object],
_options: [Object],
_maxLength: 67108863,
_headers: [Object],
__queue: [],
readyState: -1,
url: 'ws://localhost/mopidy/ws',
io: [Object],
messages: [Object],
_extensions: [Object],
_stage: 0,
_masking: true,
_protocols: [],
_requireMasking: undefined,
And it gets much longer.
Can you tell me what am I doing here wrong? I am under the impression that I understood this entirely false.