Giter Club home page Giter Club logo

Comments (7)

rhermanek avatar rhermanek commented on July 29, 2024

Hi Umut

I currently cannot reproduce your issue. From Go 1.6 (as far as i remember correctly) http2 is standard for the net/http library/package.
I just tested by sending a 90MB file through http and https and both worked. You must however overwrite the values:

ENV MAX_SCAN_SIZE=100M
ENV MAX_FILE_SIZE=100M

To allow the application to accept bigger files.

Did you pull the latest image?

BR

from clamav-rest.

umut-saribiyik-acc avatar umut-saribiyik-acc commented on July 29, 2024

Hello Hermi

Thank you for the fast response. This is not bug/issue. This is a feature request :)

The problem is not on your application level. I know that your GO REST Endpoint can handle files bigger than 32 MB. The problem Happens on Google Cloud Run Level

On Google Cloud Run (GCR) you can deploy container and communicate to a specific port over an GCR Endpoint URL. That means that GCR acts like an reverse proxy in front of your ClamAV Rest Docker container. And this Endpoint URL on GCR level, has the 32 MB file size limitation (Only with HTTP/1.1).

Client <-----request---> GCR Endpoint URL <---------> ClamAV Rest Docker container

It is possible to send files bigger than 32 MB to the GCR Enpoint, if the communication protocol is HTTP/2. This works only if the service in the docker container (Your GO ClamAV Rest Client) speaks also HTTP/2c (h2c).
Important is that the GO Rest API can handle HTTP/2c (h2c) requests.

I'm not a GO developer but for me it looks like that the used libraries (net/http) are not commuicating over HTTP2.

I think there are separate HTTP2 Libraries. https://pkg.go.dev/golang.org/x/net/http2

At least the request is that your GO REST API can handle HTTP/2c Requests additionally to HTTP/1.1. It must be configurable.

from clamav-rest.

rhermanek avatar rhermanek commented on July 29, 2024

Ah ok now I get it :D
Hmm I can take a look at it and see if I find an easy way to implement that.

from clamav-rest.

rhermanek avatar rhermanek commented on July 29, 2024

Hey @umut-saribiyik-acc
Have you tried configuring GCR to use the TLS port instead of the http port? I think that way the http library is forced to run in http2 mode.

from clamav-rest.

umut-saribiyik-acc avatar umut-saribiyik-acc commented on July 29, 2024

Hi @rhermanek

Yes, I tried also the TLS Port (9443) and it doesn't worked. Regarding to the GCR documentation, the Docker Service Endpoint must be HTTP/2c (h2c) which is not TLS / SSL.
HTTP/2c (h2c) is without SSL. You don't need certificates for it.

Google Cloud Run documentation abstract: https://cloud.google.com/run/docs/configuring/http2

image

from clamav-rest.

rhermanek avatar rhermanek commented on July 29, 2024

Hey @umut-saribiyik-acc

Ok understood. I sadly couldn't get it to run in the time I've invested but feel free to try yourself and create a PR!

from clamav-rest.

umut-saribiyik-acc avatar umut-saribiyik-acc commented on July 29, 2024

Hello @rhermanek

No problem and thanks a lot for your time :)
I will try to modify your image by putting a nginx in front of your GO REST API.

from clamav-rest.

Related Issues (19)

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.