I’m planning to store my content in IPFS, but after getting content I want to use custom logic like custom-protocol-decoding . What is proper way to do that on high loads? (need to have as small network-overhead as possible)
As I understand, I can just create custom-logic-go-app and deploy it on same machine, so it’ll just proxy content from IPFS. But what is proper way to get content from IPFS? Should usual GET localhost:8080/ipfs/<cid> be enough or do I need to use p2p connection like swarm or etc?
Or should I extend kubo -library, add some extra logic here and build my own Custom-IPFS-Docker?
The default implementation of net/http is a bit google opinionated so it only follows google’s early drafts at http2 (you NEED encryption (TLS) to have http2 which Kubo does not ship with).
You can get http2 without tls (called h2c) working, however doing this you do not have http1 support (so you would need two listeners, one for http and one for h2c).
h2c isn’t widely support also.
Edit: nvm it seems you can do upgrades, however the lack of widespread client supports make this kidna meh
The first request on an h2c connection is read entirely into memory before the Handler is called. To limit the memory consumed by this request, wrap the result of NewHandler in an http.MaxBytesHandler.
I was about to open a new issue on Kubo to add h2c support, but this is a deal breaker, we REALLY need to support streaming BIG requests. (a file upload can be GiBs big for example)