Skip to content

Works for error pages, not for 200s. #2

Open

Description

@alexbbrown

In my toy app: http://localhost:3000/devel/store/fdfd works, but http://localhost:3000/devel/ does not, can you please help me?

(ns babyproxy.handler
  (:use compojure.core)
  (:require [compojure.handler :as handler]
            [compojure.route :as route]
                        [clj-http.client :as client]
                        [tailrecursion.ring-proxy :refer [wrap-proxy]]))

(defroutes app-routes
  (GET "/" [] "Hello, world")
  #_(GET "/proxy" [] [(client/get "http://google.com")])
  (GET "/foo" [] "foo")
  #_(route/resources "/")
  (route/not-found "Not Found")
    )

(def app
 (-> app-routes (wrap-proxy "/devel" "http://www.apple.com"))
    )

Activity

  1. alexbbrown commented on Jul 3, 2013

    @alexbbrown
    Author

    the error is "safari cannot open the page" "cannot decode raw data", or on chrome: "ERR_CONTENT_DECODING_FAILED"

  2. alandipert commented on Jul 9, 2013

    @alandipert
    Member

    I haven't tested, but I suspect the apple.com address is redirecting to an SSL address. Clj-http might then be following it, but because the proxy URL isn't SSL itself, it sends a blob of encrypted stuff back to your browser.

    Do you know if the URL you're trying to proxy is redirecting to SSL?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions