       end
     end
 
-    defp do_open_conn(uri, %{proxy: {proxy_type, proxy_host, proxy_port}}, gun_opts, tls_opts) do
+    defp do_open_conn(
+           uri,
+           %{proxy: {proxy_type, proxy_host, proxy_port}} = opts,
+           gun_opts,
+           tls_opts
+         ) do
       version =
         proxy_type
         |> to_string()

         do: Map.merge(opts, %{username: username, password: password})

    defp add_proxy_auth_credentials(opts, _), do: opts

    defp open_stream(pid, method, path, headers, body, opts) do
      req_opts = %{reply_to: opts[:reply_to] || self()}

        |> tunnel_opts()
        |> tunnel_tls_opts(uri.scheme, tls_opts)
        |> Map.put(:version, version)
        |> add_socks_proxy_auth_credentials(opts)

      gun_opts =
        gun_opts
