mirror of
https://github.com/vimagick/dockerfiles
synced 2024-06-25 16:28:40 +00:00
splash: add http-proxy.lua
This commit is contained in:
parent
09c50fd29f
commit
3ac6b4a863
@ -54,6 +54,22 @@ $ docker-compose up -d
|
|||||||
|
|
||||||
## client
|
## client
|
||||||
|
|
||||||
|
```lua
|
||||||
|
-- http-proxy.lua
|
||||||
|
|
||||||
|
function main(splash, args)
|
||||||
|
splash:on_request(function(request)
|
||||||
|
request:set_proxy{
|
||||||
|
host = "61.91.251.235",
|
||||||
|
port = 8080,
|
||||||
|
}
|
||||||
|
end)
|
||||||
|
assert(splash:go("http://ifconfig.co"))
|
||||||
|
assert(splash:wait(0.5))
|
||||||
|
return splash:png()
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
-- baidu-search.lua
|
-- baidu-search.lua
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user