suppot httpc.timeout

This commit is contained in:
Cloud Wu
2016-09-24 12:28:57 +08:00
parent 18bc3216ae
commit ccb0e1b24c
2 changed files with 17 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ local dns = require "dns"
skynet.start(function()
httpc.dns() -- set dns server
httpc.timeout = 100 -- set timeout 1 second
print("GET baidu.com")
local respheader = {}
local status, body = httpc.get("baidu.com", "/", respheader)