From f16dd59feb6077dd5a8312ddc97d8401c23a46d0 Mon Sep 17 00:00:00 2001 From: asciimoo Date: Mon, 17 Oct 2016 23:26:20 +0000 Subject: [PATCH] [enh] add request timeout git-svn-id: file:///srv/svn/repo/yukari/trunk@4 f3bd38d9-da89-464d-a02a-eb04e43141b5 --- morty.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/morty.go b/morty.go index f7f260d..4954e3c 100644 --- a/morty.go +++ b/morty.go @@ -14,6 +14,7 @@ import ( "path" "regexp" "strings" + "time" "github.com/valyala/fasthttp" "golang.org/x/net/html" @@ -94,7 +95,8 @@ var SELF_CLOSING_ELEMENTS [][]byte = [][]byte{ } type Proxy struct { - Key []byte + Key []byte + RequestTimeout time.Duration } type RequestConfig struct { @@ -111,7 +113,7 @@ var HTML_BODY_EXTENSION string = `

Proxified view,
visit original site.