Skip to content

dityaaa/proxima

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Proxima 7

One of the reasons this reverse proxy is made because I need to modify client request and response from the server. Feel free to contribute 😉

Usage

Using Proxima 7 is as simple as this:

package main

import (
    "github.com/dityaaa/proxima"
    "net/http"
)

func main() {
    proxy := proxima.New("http://example.com/")
    http.HandleFunc("/", proxy.HandleRequests)
    http.ListenAndServe(":80", nil)
}

After that, you can start browse localhost. You will get respond like the target URL you have entered.

To modify request or response, you can use OnRequest and OnResponse

proxy.OnRequest(func(req *http.Request) {
    // do anything to request
})

proxy.OnResponse(func(res *http.Response) {
    // do anything to response
})

About

Customizable Go HTTP Reverse Proxy

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages