https://github.com/cab404/simple-http-proxy
https://github.com/cab404/simple-http-proxy
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cab404/simple-http-proxy
- Owner: cab404
- License: gpl-3.0
- Created: 2021-04-13T05:56:49.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-13T06:43:27.000Z (over 5 years ago)
- Last Synced: 2025-08-24T15:28:34.257Z (12 months ago)
- Language: Go
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
Simple Http Proxy
=================
KISS HTTP-only proxy, written in Go.
Configuration is done in suckless-like way: Modify `config.go` and recompile.
====
_Example configuration_
```go
package main
const (
// Two 10K allocations per connection. Pretty jumbo, it makes sense to set it lower
// if you have a lot of small writes.
BUFFER_PIPE = 10 * 1024
// Limit on URL length.
BUFFER_STATUS_LINE = 1024
)
func Config() ServerContext {
return ServerContext{
Routes: []Route{
{"cups", "cups-srv:631"},
{"megaprx", "proxytwo:8080"},
{"xample", "example.com:80"},
},
ListenAddress: ":8883",
}
}
```
====
Since this proxy doesn't modify anything inside a connection, apart from stripping first path segment, it won't usually work with regular HTTP clients without specifying Host header manually.
====
curl 0:8883/xample/ -H 'Host: example.com'
====