mirror of
https://github.com/vimagick/dockerfiles
synced 2024-06-16 03:48:44 +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
|
||||
|
||||
```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
|
||||
-- baidu-search.lua
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user