Network functions
http_get
function http_get(url: string): string?url:string
Returns string? (may be nil)
Send a synchronous HTTP GET request and return response as a string or nil on an error. Requires unsafe mode.
http_get_async
function http_get_async(url: string, on_data: fun(p1: string?, p2: string?))url:stringon_data:fun(p1: string?, p2: string?)
Send an asynchronous HTTP GET request and run the callback when done. If there is an error, response will be nil and vice versa. The callback signature is nil on_data(string response, string error). Requires unsafe mode.
udp_send
function udp_send(host: string, port: integer, msg: string): integerhost:stringport:integermsg:string
Returns integer
function udp_send(address: string, msg: string): integeraddress:stringmsg:string
Returns integer
Send data to specified UDP address. Requires unsafe mode.