     * `transport` - Whether to use TLS or plain TCP. The default varies depending on the port used. Port 443 defaults to tls.
                     All other ports default to tcp.
     * `transport_opts` - Transport options. They are TCP options or TLS options depending on the selected transport. Default: [].
-    * `tls_opts` - TLS transport options. Default: []
-    * `tcp_opts` - TCP trasnport options. Default: []
+                          Gun version: 1.3
+    * `tls_opts` - TLS transport options. Default: []. Gun from master branch.
+    * `tcp_opts` - TCP trasnport options. Default: []. Gun from master branch.
     * `ws_opts` - Options specific to the Websocket protocol. Default: %{}.
         * `compress` - Whether to enable permessage-deflate compression. This does not guarantee that compression will
                         be used as it is the server that ultimately decides. Defaults to false.

      # Support for gun master branch where transport_opts, were splitted to tls_opts and tcp_opts
      # https://github.com/ninenines/gun/blob/491ddf58c0e14824a741852fdc522b390b306ae2/doc/src/manual/gun.asciidoc#changelog

      tls_opts = Map.get(opts, :tls_opts, [])

      tls_opts =
        if uri.scheme == "https" do

          tls_opts
        end

      gun_opts = Map.take(opts, @gun_keys)

      with {:ok, pid} <- do_open_conn(uri, opts, gun_opts, tls_opts) do
        # If there were redirects, and passed `closed_conn: false`, we need to close opened connections to these intermediate hosts.
        {pid, Map.put(opts, :close_conn, true)}
      end
    end

    defp do_open_conn(uri, %{proxy: {proxy_host, proxy_port}}, gun_opts, tls_opts) do
      connect_opts = %{host: to_charlist(uri.host), port: uri.port}

      connect_opts =
        if uri.scheme == "https" do
          Map.put(connect_opts, :protocols, [:http2])
          |> Map.put(:transport, :tls)
          |> Map.put(:tls_opts, tls_opts)
        else
          connect_opts
        end

      with {:ok, pid} <- :gun.open(proxy_host, proxy_port, gun_opts),
           {:ok, _} <- :gun.await_up(pid),
           stream <- :gun.connect(pid, connect_opts),
           {:response, :fin, 200, _} <- :gun.await(pid, stream) do
        {:ok, pid}
      end
    end

    defp do_open_conn(uri, opts, gun_opts, tls_opts) do
      tcp_opts = Map.get(opts, :tcp_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 = to_charlist(uri.host)

      with {:ok, pid} <- :gun.open(host, uri.port, opts_with_master_keys) do
        {:ok, pid}
      else
        {:error, {:options, {key, _}}} when key in [:tcp_opts, :tls_opts] ->
          :gun.open(
            host,
            uri.port,
            Map.put(gun_opts, :transport_opts, tls_opts)
          )
      end
    end

    defp open_stream(pid, method, url, headers, body, :stream) do
