@Vasily are you trying to run this on an ESP8266 itself, or on an Espruino WiFi?
If it's on ESP8266 the latest builds have UDP support built in: https://github.com/espruino/Espruino/blob/master/tests/test_dgram_socket.js
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@Vasily are you trying to run this on an ESP8266 itself, or on an Espruino WiFi?
If it's on ESP8266 the latest builds have UDP support built in: https://github.com/espruino/Espruino/blob/master/tests/test_dgram_socket.js