Skip to content

A simple reverse proxy as a middleware written in Golang

License

Notifications You must be signed in to change notification settings

richardalberto/goprox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goprox godoc Travis CI Coverage

A simple reverse proxy middleware written in golang

Example

The simplest way to use GoProx is to use it as the sole handler for all requests.

package main

import (
	"os"
	"log"
	"net/http"
	"net/url"

	"github.com/damnpoet/goprox"
)

func main() {
	mux := http.NewServeMux()

	u, err := url.Parse(spadeURL)
	if err != nil {
		log.Fatal(err)
	}

	proxy := goprox.New(u, goprox.Options{})
	handler := proxy.Handler(mux)

	log.Fatal(http.ListenAndServe(":8080", handler))
}

About

A simple reverse proxy as a middleware written in Golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages