http.lua: Error informatively if insufficient LuaSec support
This commit is contained in:
parent
e587800164
commit
2a467001f6
1 changed files with 5 additions and 1 deletions
|
@ -35,7 +35,11 @@ local SCHEMES = {
|
||||||
, https = {
|
, https = {
|
||||||
port = 443
|
port = 443
|
||||||
, create = function(t)
|
, create = function(t)
|
||||||
return require("ssl.https").tcp(t) end }}
|
local https = assert(
|
||||||
|
require("ssl.https"), 'LuaSocket: LuaSec not found')
|
||||||
|
local tcp = assert(
|
||||||
|
https.tcp, 'LuaSocket: Function tcp() not available from LuaSec')
|
||||||
|
return tcp(t) end }}
|
||||||
|
|
||||||
-- default scheme and port for document retrieval
|
-- default scheme and port for document retrieval
|
||||||
local SCHEME = 'http'
|
local SCHEME = 'http'
|
||||||
|
|
Loading…
Add table
Reference in a new issue