caiyingyi
caiyingyi

Reputation: 1

How to config proxy in aleph.http/websocket-client?

Could anyone tell how to set proxy configuration with funciton aleph.http/websocket-client of
clj-commons/aleph "0.4.7-alpha7"

Here is my code:

(def proxy-config
  {:connection-options {:proxy-options {:host      "127.0.0.1"
                                        :port     7890
                                        :protocol :socks5}}})

(defn create-connection [url proxy-config]
  (try
    (let [conn @(aleph.http/websocket-client url proxy-config)]
      (info "websocket connection established, url:" url ".")
      conn)
    (catch Exception e
      (error "websocket connection established failed, url:" url "." e))))

Upvotes: 0

Views: 85

Answers (0)

Related Questions