For the 300mA the ESP8266 requires the resistor or the diode are going to have to dissipate a lot of power. With a 5 ohm resistor & 6uF 440+V cap for reactance (~339mA current limit), looks like the resistor and zener will both need to handle ~2W. Note these values assume 220VAC RMS @ 50Hz.
If you do go that route, understand that you can't touch any part of the circuit, including your ESP8266 module and anything it's connected to while it's powered, and if you don't put an additional 1Megaohm or so bleeder resistor on the capacitor used for reactance, it can still hold a dangerous charge for quite some time after being unplugged.