Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use with non-image files? #24

Closed
aaronpk opened this issue Jul 4, 2018 · 7 comments
Closed

Allow use with non-image files? #24

aaronpk opened this issue Jul 4, 2018 · 7 comments

Comments

@aaronpk
Copy link

aaronpk commented Jul 4, 2018

Is there a particular reason this is limited to image files? I am using it on a service where I also proxy video files. It was easiest for me to disable the check for the image header and allow anything through. It might be nice if this was a config option to either allow proxying anything, or lock down by type.

@dropwhile
Copy link
Member

go-camo was indeed originally intended to proxy only images, for two reasons:

  1. the camo project it was inspired by only proxied images
  2. my use-case at the time only required proxying of images

Later, a fork was created by a user to additionally proxy fonts and css. I wasn't comfortable including those in go-camo -- see discussion on #20.

In my experience, video files are "usually" either linked (by url, no content warning), uploaded (service hosts it, so no content warning), or inlined from some hosting service (eg. youtube, vimeo; ssl provided by service). Video files are also generally much larger than image content.

Can you further describe your use-case/requirements for proxying video?

@aaronpk
Copy link
Author

aaronpk commented Jul 4, 2018

Ah, I can see why css/js could be an issue for some uses.

I'm using this on the server side of my new social reader application so that all image/video URLs presented to the reader apps are https and from the same origin. The videos come from either Instagram, Twitter, or peoples' own blogs hosting video files directly. Because the majority of the content is twitter-like short posts, the video files are normally always under a minute long so they aren't actually that big.

@dropwhile
Copy link
Member

I am tentatively considering adding a cli flag to allow a few additional content types (like video/*).
If I do decide to add it, images only will certainly be the default.

@aaronpk
Copy link
Author

aaronpk commented Jul 6, 2018

While you're at it, a command line flag to change the maximum allowed file size would also be appreciated! I am running into that limit now with proxying some video files.

@dropwhile
Copy link
Member

dropwhile commented Jul 6, 2018

@aaronpk there already happens to be a flag for max size.

From the -h help output:

      --max-size=      Max response image size (KB) (default: 5120)

Note: The size is specified in Kilobytes (KB), with the default being 5120KB == 5MB.

@dropwhile
Copy link
Member

I have a branch up allow-video, with the new flag --allow-content-video.

Note: I haven't been able to test it much, as the current system I use it on wouldn't allow this additional functionality. If you have time to test it, let me know.

@dropwhile
Copy link
Member

should be closed by a92ce5e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants