https://github.com/aitoroses/go-proxy
A easy configurable HTTP request proxy
https://github.com/aitoroses/go-proxy
Last synced: about 2 months ago
JSON representation
A easy configurable HTTP request proxy
- Host: GitHub
- URL: https://github.com/aitoroses/go-proxy
- Owner: aitoroses
- Created: 2015-07-30T15:33:22.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-07-30T16:54:17.000Z (almost 11 years ago)
- Last Synced: 2025-01-11T22:31:00.875Z (over 1 year ago)
- Language: Go
- Size: 129 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go-Proxy
It offers an interface for configuring an HTTP server that mounts domains as they were it's middleware.
This helps for example when we are developing an application that has it's api on a different domain and we don't want to enable CORS by default.
# Configuration
We need to create a ```servers.json``` file. (by default)
or we can specify the file with ```--config my_servers.json```
```json
{
"port": 8080,
"servers": [
{
"mount": "/app",
"host": "my-app",
"port": 3000
},
{
"mount": "/*",
"host": "my-api",
"port": 7003
}
]
}
```
```go-proxy --config server_config.json``` will start a server on port 8080 displaying the following information
```
Proxy: /app -> http://localhost:3000
Proxy: /google -> http://www.google.com:80
Proxy: /* -> http://soa-server:7003
```
It means that any request sent over /app will be redirected to localhost:3000 for example.