V. old question, but for anyone else with similar issues:
I've had incredible difficulties with the same problem, I found this article:
https://cedalo.com/blog/enabling-websockets-over-mqtt-with-mosquitto/
The key here which I'd completely ignored until now and which it looks like you may have mis-typed is that the port is 8080 (you have 8008?). Here's my full mosquitto.conf
file contents:
listener 1883 0.0.0.0
listener 8080
allow_anonymous true
protocol websockets
I probably need to add 0.0.0.0
to the second line for consistency - or remove it from line 1, but it works and, frankly, after days of hitting a brick wall, I can now connect using the ws://
protocol.