From 3ac6b4a86357c8099b9bba29d9fb4bbf061c7232 Mon Sep 17 00:00:00 2001 From: kev Date: Wed, 7 Feb 2018 11:06:05 +0800 Subject: [PATCH] splash: add http-proxy.lua --- splash/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/splash/README.md b/splash/README.md index 96509cd..6a8664d 100644 --- a/splash/README.md +++ b/splash/README.md @@ -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