domzippilli / gcs-proxy-cloud-run Goto Github PK
View Code? Open in Web Editor NEWA Cloud Run service to proxy a GCS bucket. Useful for conditional transcoding, certain security features, etc.
License: Apache License 2.0
A Cloud Run service to proxy a GCS bucket. Useful for conditional transcoding, certain security features, etc.
License: Apache License 2.0
Hi,
I am analyzing your code by following the tutorial https://cloud.google.com/community/tutorials/cloud-run-golang-gcs-proxy
I need to be able to download files over 32MB (which is the limit with cloudRun http/1), while being able to add cloudArmor with policy rules (which I cannot do with bucket service).
So your streaming is a good solution for my need.
When I test your proxy, I have the following error :
Response size was too large. Please consider reducing response size.
So I guess it is not using streaming. When I configure the h2c
port in the cloudRun service, I have the error
upstream connect error or disconnect/reset before headers. reset reason: protocol error
By checking your code, it seems indeed that you do not handle specifically the http/2 protocol, but only the http/1.
So do I miss something ? How do you handle the streaming on 8080 without http/2 ?
Thanks for your help
Hello.
I read your nice tutorial.https://cloud.google.com/community/tutorials/cloud-run-golang-gcs-proxy
I needed a simple proxy.
The problem I encountered is that some files cannot be displayed in safari.
The cause is that it does not support HTTP range requests.
https://blog.logrocket.com/streaming-video-in-safari/
golang supports HTTP range requests.
io.Copy -> http.ServeContent
https://stackoverflow.com/questions/36540610/how-to-serve-http-partial-content-with-go
https://pkg.go.dev/net/http#ServeContent
The main benefit of ServeContent over io.Copy is that it handles Range requests properly, sets the MIME type, and handles If-Match, If-Unmodified-Since, If-None-Match, If-Modified-Since, and If-Range requests.
Thank you for reading.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.