gopherproxy

package module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2022 License: MIT Imports: 10 Imported by: 0

README

Gopher (RFC 1436) Web Proxy

Build Status

gopherproxy is a Gopher (RFC 1436) Web Proxy that acts as a gateway into Gopherspace by proxying standard Web HTTP requests to Gopher requests of the target server.

gopherproxy is written in Go (#golang) using the go-gopher library.

Demo: https://gopher.mills.io/

Installation

$ go install git.mills.io/prologic/gopherproxy/cmd/gopherproxy

Docker

Run directly from a prebuild image from the Docker Hub:

$ docker run -p 8000:8000 prologic/gopherproxy

Or build your own custom image from a source checkout:

$ docker build -t gopherproxy .
$ docker run -p 80:80 gopherproxy -uri floodgap.com

Usage

$ gopherproxy

Then simply visit: http://localhost/gopher.floodgap.com

Related projects:

  • go-gopher go-gopher is the Gopher client and server library used by gopherproxy

  • gopherclient gopherclient is a cross-platform QT/QML GUI Gopher Client using the gopherproxy library as its backend.

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version release version
	Version = "0.0.1"

	// Commit will be overwritten automatically by the build system
	Commit = "HEAD"
)

Functions

func FullVersion added in v0.0.3

func FullVersion() string

FullVersion display the full version and build

func GopherHandler added in v0.0.3

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

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 added in v0.0.3

func RobotsTxtHandler(robotstxtdata []byte) http.HandlerFunc

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

Types

type Item added in v0.0.3

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

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL