I would like to return a http-response status 200 to http-requests which are send on port 8883. The port is used for mqtt but we would like to catch http-requests on it.
The configuration I have now is (Haproxy 2.2) :
frontend smqtt
bind :8883
mode tcp
use_backend port_check if HTTP
default_backend smqtt-broker
backend smqtt-broker
mode tcp
server A-SMQTT <ip>:<port> check
server B-SMQTT <ip>:<port> check
backend port_check
mode http
http-response return status 200 content-type "text/plain" lf-string "Port Check Success"
The MQTT backend (default_backend) is working but the 'catching' of HTTP-requests is not. How can I detect (and change the backend) if a HTTP-request is coming in mode tcp?