Skip to content

thucvp-uit/http-caching-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Goals

This is a Go proxy used to caching HTTP request.
✅  Forwarding request.
✅  Cache response base on custom header attribute.
❌  Enable/Disable caching
❌  File logging

Setup DE

1. Install Go lang and project dependencies.

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

2. Redis.

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.

Deployment

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>

Resouces

Go lang
Redis
Go proxy
Go and Redis

About

Caching proxy for http request using redis and go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published