https://github.com/mohammadne/middleman
https://github.com/mohammadne/middleman
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/mohammadne/middleman
- Owner: mohammadne
- Created: 2021-07-23T15:29:28.000Z (about 5 years ago)
- Default Branch: develop
- Last Pushed: 2021-09-23T06:36:35.000Z (almost 5 years ago)
- Last Synced: 2025-03-11T01:29:09.819Z (over 1 year ago)
- Language: Go
- Size: 176 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MIDDLE MAN
> `MIDDLE MAN` will simulate a real world proxy server that clients
> will request to the proxy server (reverse proxy) and as its role is
> load-balancing between servers and caching some requests based on
> logic in proxy server
## How to run
- run servers in `first` terminal
``` zsh
go run cmd/root.go servers
```
- run proxy in `second` terminal
``` zsh
go run cmd/root.go proxy
```
- run clients in `third` terminal
``` zsh
go run cmd/root.go clients
```
- post a test `cURL` body
``` zsh
curl --header "Content-Type: application/json" \
--request POST --data '{"key":"key","value":"value"}' \
http://localhost:8090/objects
```
- get specific hashId's body with `cURL`
``` zsh
curl --header "Content-Type: application/json" \
--request GET http://localhost:8090/objects/hashId
```