goproxy: github.com/elazarl/goproxy/ext/html Index | Files

package goproxy_html

import "github.com/elazarl/goproxy/ext/html"

extension to goproxy that will allow you to easily filter web browser related content.

Index

Package Files

html.go

Variables

var IsCss goproxy.RespCondition = goproxy.ContentTypeIs("text/css")
var IsHtml goproxy.RespCondition = goproxy.ContentTypeIs("text/html")
var IsJavaScript goproxy.RespCondition = goproxy.ContentTypeIs("text/javascript",
    "application/javascript")
var IsJson goproxy.RespCondition = goproxy.ContentTypeIs("text/json")
var IsWebRelatedText goproxy.RespCondition = goproxy.ContentTypeIs("text/html",
    "text/css",
    "text/javascript", "application/javascript",
    "text/xml",
    "text/json")
var IsXml goproxy.RespCondition = goproxy.ContentTypeIs("text/xml")

func HandleString Uses

func HandleString(f func(s string, ctx *goproxy.ProxyCtx) string) goproxy.RespHandler

HandleString will receive a function that filters a string, and will convert the request body to a utf8 string, according to the charset specified in the Content-Type header. guessing Html charset encoding from the <META> tags is not yet implemented.

func HandleStringReader Uses

func HandleStringReader(f func(r io.Reader, ctx *goproxy.ProxyCtx) io.Reader) goproxy.RespHandler

Will receive an input stream which would convert the response to utf-8 The given function must close the reader r, in order to close the response body.

Package goproxy_html imports 9 packages (graph) and is imported by 63 packages. Updated 2018-07-25. Refresh now. Tools for package owners.