Skip to content

⚡ Proxy that compresses images to low-resolution. Adapted to be Hosted on Google-Cloud-Functions

License

Notifications You must be signed in to change notification settings

changhaitravis/bandwidth-hero-proxy-gcf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bandwidth Hero Data Compression Service

NSP Status

This data compression service is used by Bandwidth Hero browser extension. It compresses given image to low-res WebP or JPEG image. Optionally it also converts image to greyscale to save even more data.

It downloads original image and transforms it with Sharp on the fly without saving images on disk.

This is NOT an anonymizing proxy — it downloads images on user's behalf, passing cookies and user's IP address through to the origin host.

Deployment

Google Cloud Functions

Options to set when deploying to google cloud

  • Memory Allocated: between 256MB - 512MB recommended
  • Runtime: NodeJS 8+ (Sharp doesn't build on Node 6 default)
  • Function to Execute: bandwidthHeroProxy

ENVIRONMENT_VARIABLES MIN_COMPRESS_LENGTH=2048 (minimum byte length for an image to be compressible; default 2048 ~2kB)

Development

node ./express-wrapper.js

About

⚡ Proxy that compresses images to low-resolution. Adapted to be Hosted on Google-Cloud-Functions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%