Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alexbbrown opened this issue Jul 3, 2013 · 2 comments
Open

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

alexbbrown opened this issue Jul 3, 2013 · 2 comments

Comments

@alexbbrown
Copy link

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"))
    )
@alexbbrown
Copy link
Author

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

@alandipert
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants