This is a Go proxy used to caching HTTP request.
✅ Forwarding request.
✅ Cache response base on custom header attribute.
❌ Enable/Disable caching
❌ File logging
Go lang
brew install go
Project dependencies
go get -u github.com/elazarl/goproxy
go get -u github.com/go-redis/redis
[Optional] Atom and go-plus
Install Redis package
brew install redis
Install Redis as OSX service
brew services start redis
Connect to redis server to make sure it was start successfully
redis-cli
Ping Redis server
redis 127.0.0.1:6379> ping
If Redis server responses PONG, your server was up and running.
Start your proxy by
go run proxy.go
Your proxy will be start at *:48080
Configure your application server with JVM proxy options:
-Dhttp.proxyHost=<proxyHostName>
-Dhttp.proxyPort=<proxyPortNumber>
-Dhttps.proxyHost=<secureProxyHostName>
-Dhttps.proxyPort=<secureProxyHostName>
Useful Redis commands
NOTES: You should connect to Redis server using redis-cli
Flush all data
flushall
Check all keys(urls)
keys *
Check if a key(url) exists
get <key>