Skip to content
/ camo Public
forked from iongchun/camo

🔒 an http proxy to route images through SSL

License

Notifications You must be signed in to change notification settings

Renkas/camo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

camo

Camo is all about making insecure assets look secure. This is an SSL image proxy to prevent mixed content warnings on secure pages served from GitHub.

We want to allow people to keep embedding images in comments/issues/READMEs/google charting.

There's more info on the GitHub blog.

Using a shared key, proxy URLs are encrypted with hmac so we can bust caches/ban/rate limit if needed.

Features

  • Proxy remote images with a content-type of images/*
  • Proxy images < 5 MB
  • Proxy google charts
  • 404s for anything other than a 200 or 304 HTTP response

At GitHub we render markdown and replace all of the src attributes on the img tags with the appropriate URL to hit the proxies. There's example code for creating URLs in the tests.

Testing Functionality

Start the server

% coffee server.coffee

In another shell

% rake

Debugging

To see the full URL resclient is hitting etc, try this.

% RESTCLIENT_LOG=stdout rake

Deployment

You can see an example god config here.

To enable useful line numbers in stacktraces you probably want to compile the server.coffee file to native javascript when deploying.

% coffee -c server.coffee
% /usr/bin/env PORT=9090 CAMO_KEY="<my application key>" node server.js

About

🔒 an http proxy to route images through SSL

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CoffeeScript 52.4%
  • Ruby 47.6%