gopherproxy: Index | Files

package gopherproxy

import ""


Package Files

gopherproxy.go template.go

func GopherHandler Uses

func GopherHandler(tpl *template.Template, robotsdata *robotstxt.RobotsData, uri string) http.HandlerFunc

GopherHandler returns a Handler that proxies requests to the specified Gopher server as denoated by the first argument to the request path and renders the content using the provided template. The optional robots parameters points to a robotstxt.RobotsData struct to test user agents against a configurable robotst.txt file.

func ListenAndServe Uses

func ListenAndServe(bind, robotsfile, uri string) error

ListenAndServe creates a listening HTTP server bound to the interface specified by bind and sets up a Gopher to HTTP proxy proxying requests as requested and by default will prozy to a Gopher server address specified by uri if no servers is specified by the request. The robots argument is a pointer to a robotstxt.RobotsData struct for testing user agents against a configurable robots.txt file.

func RobotsTxtHandler Uses

func RobotsTxtHandler(robotstxtdata []byte) http.HandlerFunc

RobotsTxtHandler returns the contents of the robots.txt file if configured and valid.

type Item Uses

type Item struct {
    Link template.URL
    Type string
    Text string

Package gopherproxy imports 10 packages (graph). Updated 2019-12-27. Refresh now. Tools for package owners.