Giter VIP home page Giter VIP logo

gcs-proxy-cloud-run's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gcs-proxy-cloud-run's Issues

Question : How does the streaming works without http/2

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

Consider using http.ServeContent instead of io.Copy

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.