Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Generic cluster for DispatchHttpCall? #438

Open
jonfriesen opened this issue Apr 24, 2024 · 0 comments
Open

Question: Generic cluster for DispatchHttpCall? #438

jonfriesen opened this issue Apr 24, 2024 · 0 comments

Comments

@jonfriesen
Copy link

I'd like to make calls using proxywasm.DispatchHttpCall(...) to various URLs. Is it possible to have a cluster in the envoy config that will use the :authority header and forward the request on?

I was exploring something like:

  clusters:
  - name: dynamic_forward_proxy_cluster
    lb_policy: CLUSTER_PROVIDED
    cluster_type:
      name: envoy.clusters.dynamic_forward_proxy
      typed_config:
        "@type": type.googleapis.com/envoy.extensions.clusters.dynamic_forward_proxy.v3.ClusterConfig
        dns_cache_config:
          name: dynamic_forward_proxy_cache_config
          dns_lookup_family: V4_ONLY

but end up getting errors like:

[debug][router] [source/common/router/router.cc:514] [Tags: "ConnectionId":"0","StreamId":"1203041025397599499"] cluster 'dynamic_forward_proxy_cluster' match for URL '/post'
[debug][upstream] [source/extensions/clusters/dynamic_forward_proxy/cluster.cc:396] host httpbin.org:80 not found
[debug][upstream] [source/common/upstream/cluster_manager_impl.cc:2010] no healthy host for HTTP connection pool
[debug][http] [source/common/http/async_client_impl.cc:106] async http request response headers (end_stream=false):
':status', '503'
'content-length', '19'
'content-type', 'text/plain'

[14954665][error][wasm] [source/extensions/common/wasm/context.cc:1193] wasm log: dispatch http call failed: error status returned by host: internal failure
[14954665][critical][wasm] [source/extensions/common/wasm/context.cc:1196] wasm log: Error dispatching payload: error status returned by host: internal failure

with headers like:

	hs := [][2]string{
		{"accept", "*/*"},
		{":authority", "httpbin.org"},
		{":method", "POST"},
		{":path", "/post"},
		{":scheme", "http"},
		{"Content-Type", "application/json"},
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant