 
     defp do_open_conn(uri, %{proxy: {proxy_host, proxy_port}}, gun_opts, tls_opts) do
       connect_opts =
-        tunnel_opts(uri)
+        uri
+        |> tunnel_opts()
         |> tunnel_tls_opts(uri.scheme, tls_opts)
 
       with {:ok, pid} <- :gun.open(proxy_host, proxy_port, gun_opts),


      # if gun used from master
      opts_with_master_keys =
        Map.put(gun_opts, :tls_opts, tls_opts)
        |> Map.put(:tcp_opts, tcp_opts)

      host =

        end

      tls_opts =
        opts
        |> Map.get(:tls_opts, [])
        |> Keyword.merge(Map.get(opts, :transport_opts, []))

      tls_opts =
