{"id":22740726,"url":"https://github.com/rjyo/node-image-proxy","last_synced_at":"2025-04-14T05:53:54.364Z","repository":{"id":1497331,"uuid":"1749951","full_name":"rjyo/node-image-proxy","owner":"rjyo","description":"An image proxy written in node.js with a redis backend, Ready to run on cloud service like CloudFoundry.","archived":false,"fork":false,"pushed_at":"2011-05-18T05:40:40.000Z","size":306,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-15T12:18:24.419Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rjyo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-05-15T03:48:52.000Z","updated_at":"2015-12-01T22:51:41.000Z","dependencies_parsed_at":"2022-08-16T13:25:21.732Z","dependency_job_id":null,"html_url":"https://github.com/rjyo/node-image-proxy","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjyo%2Fnode-image-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjyo%2Fnode-image-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjyo%2Fnode-image-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjyo%2Fnode-image-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rjyo","download_url":"https://codeload.github.com/rjyo/node-image-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248830389,"owners_count":21168272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-10T23:10:27.872Z","updated_at":"2025-04-14T05:53:54.329Z","avatar_url":"https://github.com/rjyo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"About node-image-proxy\n===\nAn image proxy written in node.js with a Redis backend, Ready to run on cloud services like CloudFoundry.\n\nWhat Is This For?\n---\nI use posterous to update my blog from iPhone (which is much easier than WordPress's offical client), but the images from posterous are blocked in mainland China by the GFW. This image proxy can by-pass the block by sending the images from your own server.\n\nWhy Redis?\n---\nnode-image-proxy caches not only the image, but also the headers send from the original server. Redis's hset/hget commands can save easily both of them as a set. It's schema-less!\n\nWhat Else?\n---\nI also included 3 demos in this project.\n\n* `examples/image\\_http.js` - download a file using node's stand http module. \n* `examples/image\\_request.js` - download a file using [request](https://github.com/mikeal/request) and save it to Redis.\n* `examples/image\\_recover.js` - recover a file from Redis to disk.\n\nInstallation\n---\nYou need to add a simple Javascript to your blog, which let the blocked images be proxied. I wrote a jQuery plugin for that (public/imgProxy.js), but it's very simple and you can rewrite it using whatever you like.\n\n```javascript\n  (function($) {\n    $.fn.imgProxy = function(options) {\n      var settings = {\n        \"api-root\" : \"http://img.yourserver.com/u/\"\n      };\n      if (options) {\n        $.extend(settings, options);\n      }\n\n      this.each(function() {\n        var element = $(this);\n        if (this.tagName.toLowerCase() == \"img\" \u0026\u0026 element.attr(\"src\")) {\n          element.attr(\"src\", settings[\"api-root\"] + encodeURIComponent(element.attr(\"src\")));\n        }\n      });\n    };\n  })(jQuery);\n\n\n  $ = jQuery;\n  $(document).ready(function(){\n    $(\".posterous_autopost img\").imgProxy();\n  });\n```\n\nInstall On Cloud Foundry\n---\nHere is the how to install it on Cloud Foundry:\n\n```bash\n  gem install vmc\n  vmc target api.cloudfoundry.com\n  vmc login # if you've got the invitation, it's in your mail\n  vmc push your_app\n  vmc env-add your_app NODE_ENV=production\n\n  # update your app\n  vmc update your_app\n\n  # check status/logs\n  vmc stats your_app\n  vmc logs your_app\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjyo%2Fnode-image-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frjyo%2Fnode-image-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjyo%2Fnode-image-proxy/lists"}