A simple go program to proxy http request through a server with caching

go-http-proxy

A simple go program to proxy http requests through a server with caching

Usage

All cli options are optional, and have the default values of

secret: 'secret'
cachetime: '30m'
allowedheaders: 'content-type'

To change these defaults, just run the command with options

go-http-server --secret 'supersecret' --cachetime 30m --allowedheaders 'content-type,etag,date'

After running the server you can access the service on port 3000 http://localhost:3000/?url=<the-url-to-proxy&token=<the auth token>&expires=<token expiry time>. The token is a SHA256 Hash of the url + secret + expiry time. So as long as nobody knows your secret key nobody else can access the router.

Installation

Download latest release

go to the releases page and download the latest release

# Untar the files
tar -xfv go-http-proxy-linux-amd64.tar.gz
# And start the executable
./go-http-server

Using go get

go get -v https://github.com/GQDeltex/go-http-proxy.git
~/go/bin/go-http-server

Building yourself

Install requirements

apt install golang git

Clone the repo into your go workspace and get the dependencies

git clone https://github.com/GQDeltex/go-http-proxy.git ~/go/src/github.com/GQDeltex/go-http-proxyk
cd ~/go/src/github.com/GQDeltex/go-http-proxy
go mod download

After that you can either build the binary in that folder or install it into ~/go/bin/go-http-proxy

go build # Executable now in ./go-http-proxy
# Or install
go install # Executable now in ~/go/bin/go-http-proxy

Now you can run the proxy by starting the Executable

./go-http-proxy
# Or if you've used go install
~/go/bin/go-http-proxy

You can even add ~/go/bin to your path to have it even easier

# ~/.bashrc
PATH=$PATH:~/go/bin

Now you can run by typing

go-http-proxy
Owner
I'm a young guy from Germany. I mostly build Webapps, but also built CLI tools and experimented with ML/AI. For more Information visit my Website:
null
Similar Resources

Aidos Kuneen (v2 network) daemon program that is controlled through the command line and remotely via RPC calls

adk-daemon: aidosd.v2 aidosd (v2) is a deamon which acts as bitcoind for adk. This version has been built specifically for network mesh version 2+ For

Dec 1, 2021

“Dear Port80” is a zero-config TCP proxy server that hides SSH connection behind a HTTP server!

Dear Port80 About The Project: “Dear Port80” is a zero-config TCP proxy server that hides SSH connection behind a HTTP server! +---------------------

Jun 29, 2022

Httpecho - Golang HTTP echo server accepting malformed request

httpecho The same thing as jmalloc/echo-server but malformed HTTP requests are e

Jun 3, 2022

Smocker is a simple and efficient HTTP mock server and proxy.

Smocker is a simple and efficient HTTP mock server and proxy.

Smocker (server mock) is a simple and efficient HTTP mock server. The documentation is available on smocker.dev. Table of contents Installation With D

Jan 7, 2023

Super simple tcp intranet penetration proxy program

A super easy to configure tcp intranet penetration proxy program that forwards intranet tcp ports to public network servers. Tested proxies for intranet HTTP services, windows remote desktop, ssh access and other scenarios.

Dec 11, 2022

A simple tool for retrieving a request's IP address on the server.

reqip A simple tool for retrieving a request's IP address on the server. Inspired from request-ip Installation Via go get go get github.com/mo7zayed/r

Oct 26, 2022

Http-server - A HTTP server and can be accessed via TLS and non-TLS mode

Application server.go runs a HTTP/HTTPS server on the port 9090. It gives you 4

Feb 3, 2022

A http proxy server chaining a upstream which needs authentication headers.

Normalize HTTP Proxy A http proxy server chaining a upstream which needs authentication headers. local - [np] - upstream - destination Usage Norma

Dec 14, 2022
LinkPreview.net Proxy Server with Caching

LinkPreview.net Proxy Server with Caching Description LinkPreview API/Image Proxy Server with Caching written in Go. Features: In-memory caching layer

Nov 19, 2021
Request: a HTTP request library for Go with interfaces and mocks for unit tests

Requester Request is a HTTP request library for Go with interfaces and mocks for

Jan 10, 2022
Http-logging-proxy - A HTTP Logging Proxy For Golang

http-logging-proxy HTTP Logging Proxy Description This project builds a simple r

Aug 1, 2022
concurrent caching proxy and decoder library for collections of PMTiles

go-pmtiles A caching proxy for the serverless PMTiles archive format. Resolves several of the limitations of PMTiles by running a minimalistic, single

Jan 2, 2023
A simple tool to convert socket5 proxy protocol to http proxy protocol

Socket5 to HTTP 这是一个超简单的 Socket5 代理转换成 HTTP 代理的小工具。 如何安装? Golang 用户 # Required Go 1.17+ go install github.com/mritd/s2h@master Docker 用户 docker pull m

Jan 2, 2023
Tcp-proxy - A dead simple reverse proxy server.

tcp-proxy A proxy that forwords from a host to another. Building go build -ldflags="-X 'main.Version=$(git describe --tags $(git rev-list --tags --max

Jan 2, 2022
Go-http-sleep: Delayed response http server, useful for testing various timeout issue for application running behind proxy

delayed response http server, useful for testing various timeout issue for application running behind proxy

Jan 22, 2022
get WHOIS with library, command or through HTTP server

Go Whois Provide WHOIS library, command line tool and server with restful APIs to query whois information for domains and IPs. It's also available to

Oct 24, 2022
Starting my way through learning Golang by setting up an HTTP server.

Lets-Go Setting up an HTTP server with Golang. Building a simple server with "net/http" library in Golang. This is a simpe server with two routes, the

Aug 22, 2022