Connect to mqtt broker with kong

Hi Experts,

Im running an MQTT broker in a docker environment and i would like to expose the MQTT port and MQTT websocket ports through kong.

The websocket port was no problem as it uses http but im having trouble with the MQTT port.

I tries creating a tcp route and just forwarding the request to the proper port but i wasnt able to get it working

There are my routes in kong.yml

  • name: mqtt-service
    url: tcp://broker:1883
    routes:

    • name: mqtt-route
      protocols:
      • tcp
        destinations:
      • port: 1888
  • name: mqtt-broker-ws-service
    url: http://broker:1884
    routes:

    • name: mqtt-ws-route
      protocols:
      • http
        paths:
      • /mqtt-ws
        strip_path: true
        plugins:
    • name: cors

would be greatful for any ideas