Comments (4)
cc @rshriram @lizan @mattklein123 @alyssawilk
from envoy.
I tried adding an HTTP Lua filter to see if I could modify the ":authority" and it appears to have worked. We really don't want to introduce Lua into our system but this allowed me to test out an option if there is no native configuration way to do this with Envoy. If doing it with code is the only way then we'd much prefer to use the HTTP WASM filter as you can pass dynamic configuration into the filter and we prefer to write Go and compile to WASM. I'm still hoping there is a native way to do this without code.
Here's the code that simply always replaces the upstream port with 80
to see if it was possible. I didn't figure out how to pass dynamic port mappings to the script such as mentioned in the description of this issue.
-- Define the Lua filter
function envoy_on_request(request_handle)
-- Retrieve the destination address and port
local authority_header = request_handle:headers():get(":authority")
local destination_address, existing_port = authority_header:match("^(.-):?(%d*)$")
-- If there's an existing port, remove it
if existing_port then
authority_header = destination_address
end
local destination_port = "80" -- Change this to the desired upstream port
-- Modify the destination port
request_handle:headers():replace(":authority", authority_header .. ":" .. destination_port)
end
from envoy.
We decided to rewrite the Lua as Go code and output WASM and load it as a HTTP WASM filter which also accepts a configuration which is like the port_value
which exists in the SNI dynamic forward proxy. This is the best solution that we could come up with at this time. We are hopeful we missed something within the Envoy configuration.
from envoy.
I'm closing this as we have a solution with a WASM filter. It works for our needs as there is no way to make this work with standard Envoy configuration.
from envoy.
Related Issues (20)
- New CEL convenience function: random() HOT 8
- Newer release available `com_github_c_ares_c_ares`: v1.31.0 (current: cares-1_20_1) HOT 1
- Perf issue with c-ares DNS resolver HOT 10
- Control Weighted Cluster Weights via Runtime config
- Question about request_mirroring#disable_shadow_host_suffix_append HOT 2
- Garbled characters are displayed when setting cookie attribute HOT 3
- Qus: Does envoy support connecting to upstream Redis with TLS enabled? HOT 4
- Newer release available `com_github_zlib_ng_zlib_ng`: 2.1.7 (current: 2.0.7) HOT 1
- Newer release available `io_bazel_rules_go`: v0.48.1 (current: v0.46.0) HOT 1
- Newer release available `rules_python`: 0.33.2 (current: 0.32.2) HOT 1
- CONNECT-UDP in forwarding proxy mode resets stream and fails to send HTTP Datagrams HOT 7
- Regarding use of envoy api along with envoy api dependencies HOT 13
- Newer release available `com_github_wasmtime`: v22.0.0 (current: v9.0.3)
- ext_proc: should return 504 on timeout error HOT 1
- Does envoy supports configuring upstream application layer protocol? HOT 4
- Clean up Stats header import of MemoryTest HOT 1
- Newer release available `aspect_bazel_lib`: v2.7.8 (current: v2.7.7) HOT 1
- Newer release available `com_github_bufbuild_buf`: v1.34.0 (current: v1.32.2)
- Newer release available `com_github_datadog_dd_trace_cpp`: v0.2.2 (current: v0.2.1)
- Newer release available `io_opentelemetry_cpp`: v1.16.0 (current: v1.14.2) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from envoy.