Cupcake verison
To remove cupcake code see comments in code.
For lolin ESP8622
File
-> Prefrences
Additionl boards manager URLs
https://arduino.esp8266.com/stable/package_esp8266com_index.json
Tools
-> Board
LOLIN(WEMOS) D1 R2 & mini
(This code may work on other devices, but untested)
Sketch
-> Libraries
-> Manage Libraries
WebSockets
by Markus Sattler
(v2.4 testes)