          target-webserver#
          ~ring-handler
          "/hello"))
+     (with-app-with-config proxy-app#
+       [jetty9-service]
+       {:webserver ~proxy}
+       (let [proxy-webserver# (get-service proxy-app# :WebserverService)]
+         (if ~proxy-opts
+           (add-proxy-route proxy-webserver# ~proxy-config "/hello-proxy" ~proxy-opts)
+           (add-proxy-route proxy-webserver# ~proxy-config "/hello-proxy")))
+       ~@body)))
+
+(defmacro with-target-and-proxy-servers-redirect
+  [{:keys [target proxy proxy-config proxy-opts ring-handler-target ring-handler-redirect]} & body]
+  `(with-app-with-config proxy-target-app#
+     [jetty9-service]
+     {:webserver ~target}
+     (let [target-webserver# (get-service proxy-target-app# :WebserverService)]
+       (add-ring-handler
+         target-webserver#
+         ~ring-handler-target
+         "/hello")
+       (add-ring-handler
+         target-webserver#
+         ~ring-handler-redirect
+         "/redirect"))
      (with-app-with-config proxy-app#
        [jetty9-service]
        {:webserver ~proxy}

            (is (= (read-string (:body response)) params)))
          (let [response (http-get (str "http://localhost:10000/hello-proxy" query))]
            (is (= (:status response) 200))
            (is (= (read-string (:body response)) params))))))))

                                           ((:headers req) "cookie"))}
    {:status 404 :body "D'oh"}))

(defn test-handler
  [req]
  {:status 200
   :body   "Hello, World!"})

(defn redirect-test
  [req]
  {:status  302
   :headers {"Location" "http://localhost:9000/hello"}
   :body    ""})

(defmacro with-target-and-proxy-servers
  [{:keys [target proxy proxy-config proxy-opts ring-handler]} & body]
  `(with-app-with-config proxy-target-app#
