Git Product home page Git Product logo

node-hoodie-proxy's Introduction

Hoodie Proxy

A proxy to allow running Hoodie or CouchDB behind an Apache Server on shared hosting.

The Problem

CouchDB database names and document IDs may contain slashes. Slashes inside the names need to be escaped as %2F in the URL, so CouchDB can distinguish them from the slashes around the database name. Hoodie’s API is essentially CouchDB and Hoodie uses slashes in its database names and document IDs.

CouchDB’s recommended reverse proxy setup is not suitable for shared hosting as it requires configuring mod_proxy as well as AllowEncodedSlashes – neither of which can be done in .htaccess files.

Using mod_rewrite is possible in a shared hosting setup but will convert the escaped %2F slashes back to /. Using its [B] flag will lead to double escaped %252f.

A number of problems come together here. Probably each of the involved softwares could make things easier:

  • mod_rewrite letting my easily create exactly the URLs I want instead of changing the escaping
  • Apache allowing proxy and slashes configuration on .htaccess level
  • Hoodie not using slashes in database names and document IDs

The Workaround

Set up a http proxy in node that tries to fix the URLs Hoodie needs after mod_rewrite breaks them by replacing / with %2F in some places.

The setup then is, with hoodie-proxy being able to access the port Hoodie runs on:

User → Apache with mod_rewrite reverse proxy → hoodie-proxy → Hoodie

Usage

hoodie-proxy uses two parameters

  • --port [-p]: the port to open the proxy on [6010]
  • --target [-t]: the base URL to proxy to [http://127.0.0.1:6001]

Contact

2014 by Sven-S. Porst <[email protected]>

https://github.com/ssp/node-hoodie-proxy

node-hoodie-proxy's People

Contributors

ssp avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar  avatar

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.