WebSocket API problems


I am trying to establish a connection using the websocket api, but it fails to connect when sending an request.

JSON: {“jsonrpc”: “2.0”, “id”: 1, “method”: “core.playback.play”}

enabled = true
hostname =
port = 6680
static_dir =
zeroconf = Mopidy HTTP server on $hostname

If I paste the url directly in the browser it says: Can “Upgrade” only to “WebSocket”.

Anyone know what I could be missing??


I was really hoping that someone had a clue.

Is there any way I can test if the server is setup right??

Can anyone get this online service to work with their setup?

Thanks in advance


It’s not clear what you are trying to do here, you cannot just paste a websocket address in your web browser and expect your browser to do anything useful with that. https://en.wikipedia.org/wiki/WebSocket

For testing, try Mopidy-API-Explorer.


The final goal is to make a native Windows Phone App (or Xamarin) that communicates with Mopidy using RPC-Json 2.0 communication on websocket.

I have started a prototype trying requests like the one posted in the first message in this thread but it fails. So my best guess is that either my code doesn’t work or Mopidy is not set up properly. That is what I am trying to find out. I have a suspicion that that my Mopidy setup is not correctly done?

But I am a totally newbie in Mopidy so maybe I just got it wrong:-)

Let me try the Mopidy-API-Explorer. If this is working, as I understand you, this means that Mopidy is set up correctly and should be ready to communicate on my local network when calling from a Windows Phone app or similar.


So yes, install that API-Explorer extension and try some of the examples it provides or just install one of the Web clients, if that is working then you know Mopidy’s http module is correctly configured and ready for you to use yourself. Either way I recommend you try out API-Explorer, I think it’s useful when starting out.