Debugging MQTT over websockets on Envoy 1.28.0

I have migrated our Envoy installation from Envoy 1.11.1 to 1.28.0, and am now also using SNI for selecting the correct certificate. A big part of that migration is upgrading the syntax of the configuration for Envoy from the v2 API to the v3 API. The upgrade went well, except for our websocket-based MQTT service…

Weiterlesen

envoy serving a static response

Besides routing and redirecting you can serve static responses with Envoy. In this case I want to serve a forbidden response (403) route_config:   virtual_hosts:   – name: picockpit     domains: [“picockpit.local:443”, “picockpit.local”]     routes:       – match: { prefix: “/demo” }         direct_response:           status: 403           body:             inline_string: “Forbidden.”        – match: {prefix: “/”}         route: {cluster: target_picockpit} It can also serve…

Weiterlesen

envoy not connecting to VerneMQ for MQTT over websockets, error code 503

Some quick background information for anyone running into the same issues, and how to debug them. Error code 503 This is the error code I am getting: Error during WebSocket handshake: Unexpected response code: 503. Set envoy logging to debug Here’s my docker-compose.yaml for envoy: version: ‘3.7’ services:   envoy:     build:       context: ./       dockerfile: Dockerfile     container_name:…

Weiterlesen

envoy websockets per route configuration, JavaScript test setup

In my article yesterday I discussed the configuration & test of envoy for proxying websockets at length. Today I would like to add some additional information. correct syntax for websocket upgrade per route You can enable websocket upgrade per route. No need to add it globally: – name: envoy.http_connection_manager    config:      #upgrade_configs:      #  – upgrade_type: websocket     …

Weiterlesen

envoy, docker and websockets – debugging and configuration

Websockets are an exciting technology, allowing you to upgrade a HTTP connection to a long-running persistent binary connection, which you can use to send bi-directional messages. As an aside, the MQTT protocol can be transported using websockets – which is the only (?) way for a JavaScript client delivered by the website, for instance. In…

Weiterlesen

Route & Redirect with envoy

An example envoy.yaml showing how to route & redirect. There are different options, see here https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/route/route.proto#route-redirectaction This envoy.yaml routes /taxgod and /taxgod/ (the second could probably be omitted because the first one should also match it, I think) to a new port and a different protocol. /picockpit is simply redirected to / and then finally…

Weiterlesen

Envoy routing and rewriting snippet

It is possible to rewrite URLs with Envoy for the backend. Please note that the HTML output needs to have the proper routes! (That is why I am not going to investigate further in this direction). REF: https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/route/route.proto#route-route  Also note that the string is going to be rendered literally for direct_response –> body –> inline_string,…

Weiterlesen