code: function handleUnknown(request, response, next) {
  
          if (request.url.indexOf(config.prefix) === 0) {
              // handles /proxy/ and /proxy
              if (request.url == config.prefix || request.url == config.prefix.substr(0, config.prefix.length - 1)) {
                  return response.redirectTo("");
              }
              // handles cases like like /proxy/google.com and redirects to /proxy/http://google.com/
              return response.redirectTo("http://" + request.url.substr(config.prefix.length));
          }
  
          // if there is no referer, then either they just got here or we can't help them
          if (!request.headers.referer) {
              return next(); // in express apps, this will let it try for other things at this url. Otherwise, it just redirects to the home page
          }
  
          var ref = url.parse(request.headers.referer);
  
          // if we couldn't parse the referrer or they came from another site, they send them to the home page
          if (!ref || ref.host != thisHost(request)) {
              return next();
          }
  
          // now we know where they came from, so we can do something for them
          if (ref.pathname.indexOf(config.prefix + 'http') === 0) {
              var real_url = getRealUrl(ref.pathname);
              var real_uri = url.parse(real_url);
              var target_url = real_uri.protocol + "//" + real_uri.host + request.url;
              debug("recovering broken link to %s", request.url);
              // now, take the requested pat on the previous known host and send the user on their way
              // todo: make sure req.url includes the querystring
              return response.redirectTo(target_url);
          }
  
          // fallback - there was a referer, but it wasn't one that we could use to determine the correct path
          next();
      }
docs: This is what makes this server magic: if we get an unrecognized request that wasn't corrected by
  proxy's filter, this checks the referrer to determine what the path should be, and then issues a
  307 redirect to a proxied url at that path
  
  todo: handle querystring and post data