clj-http icon indicating copy to clipboard operation
clj-http copied to clipboard

socks proxy uses local DNS resolution

Open wmatson opened this issue 5 years ago • 1 comments

(require '[clj-http.client :as http])
(require '[clj-http.conn-mgr :as conn-mgr])

(http/request {:url "http://hidden-to-local/example"
               :method :get
               :connection-manager
               (conn-mgr/make-socks-proxied-conn-manager "127.0.0.1" 12345))

;; => UnknownHostException

Effectively, the host ip for hidden-to-local ends up getting resolved with the local DNS, but should be resolved with the remote one (if only when provided a particular option/flag perhaps?).

This stackoverflow answer outlines how to get the remote side of the proxy to perform the DNS lookup.

wmatson avatar May 20 '20 21:05 wmatson

PR #529 may help with the implementation of a fix here, or used to hack a workaround.

wmatson avatar May 20 '20 23:05 wmatson