http proxy support by setting NETWORK_PROXY variable

This should implement feature request in #919.
This commit is contained in:
chrox
2014-10-05 16:04:49 +08:00
parent 87e9f34397
commit 3147ffb08a
2 changed files with 11 additions and 0 deletions

View File

@@ -178,6 +178,11 @@ KOBO_LIGHT_ON_START = -1 -- -1 or 0-100. -1 leaves light as it is, oth
KOBO_SCREEN_SAVER = "" -- image or directory with pictures or "-"
KOBO_SCREEN_SAVER_LAST_BOOK = true -- get screensaver from last book if possible
-- Network proxy settings
-- proxy url should be a string in the format of "http://localhost:3128"
-- proxy authentication is not supported yet.
NETWORK_PROXY = nil
-- ####################################################################
-- following features are not supported right now
-- ####################################################################

View File

@@ -83,4 +83,10 @@ function NetworkMgr:getWifiStatus()
return false
end
-- set network proxy if global variable NETWORK_PROXY is defined
if NETWORK_PROXY then
local http = require("socket.http")
http.PROXY = NETWORK_PROXY
end
return NetworkMgr