indulona
a year ago
Just like ever single proxy written in Go, it just uses the core httputil library with a shit ton of custom code on top of it.
Anyone who writes Go does not need any of this. And those who do not write Go, can still write their own in no time because it is literally couple of lines of code. No harder than running a webserver in Go(two lines of code).
https://github.com/andrearaponi/dito/blob/a57d396476cc618678...
cybrox
a year ago
Why would I write my own http proxy in Go if I needed rate limiting and something like this was provided as an easy to use binary or docker image?
indulona
a year ago
because all that is is no more than 50 lines of code. it's so easy that nothing else makes much more sense. Go's standard library has all you need to run networking services from the get go. you really do not need these things. Go with nginx, haproxy and similar things if you need every last bit of performance, but otherwise, you can just write your on in no time. Not only that, you can tailor-made it to suit whatever use case you have and that knowledge will only make you more productive in the future.
withinboredom
a year ago
Now I kinda want to test it to see how it works if your application flushes lots of little packets <MTU. Some proxies will try to recombine the packets to make the connection more efficient, some will just forward as-is. But this is super important behavior to be familiar with (and documented) for things like websockets.