use async dns resolve in httpc, and dns resolve cache by ttl. see about issue #253

This commit is contained in:
Cloud Wu
2015-11-25 13:09:41 +08:00
parent d35388581f
commit c180036bed
3 changed files with 89 additions and 20 deletions

View File

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