Connect traefik hub to a contain with a docker host network

I have a NodeRed service running in docker-compose. It uses network_mode: "host" so that it can listen to UDP traffic on the local network (coming from smart devices).

Is there a way to publish a connection on Traefik Hub that will connect to this NodeRed comtainer?

I was thinking I might need to have a host network and a docker internal network but I don't know how to proceed.

docker.compose.yml

################################################################################
# Node-RED Stack or Compose
################################################################################
# docker stack deploy node-red --compose-file docker-compose-node-red.yml
# docker-compose -f docker-compose-node-red.yml -p myNoderedProject up
#
# Should add build steps to included dependencies such as
# npm install node-red-contrib-tts-ultimate
# npm install node-red-contrib-sonos-events
# npm install node-red-contrib-sonos-plus
################################################################################
version: "3.7"

services:
  nodered:
    image: nodered/node-red:3.0.1
    logging:
      driver: "json-file"
      options:
        max-file: "5"
        max-size: "10m"
    environment:
      - TZ=Europe/Zurich

    command:
      - "--log.level=warn"

    # ports:
    #   - "1880:1880"

    # Network mode host allows docker to receive UDP responses from host network (i.e. smart home)
    network_mode: "host"
    volumes:
      - ./data:/data
    labels:
      # Because I prefer to do this one in yml file
      - "traefik.enable=false"

nodered.yml in traefik conf

http:
    # Add the router
    routers:
      nodered:
        entryPoints:
        - websecure

        service: nodered
        rule: Host(`nodered.mydomain`)
        tls:
          certResolver: leresolver
          domains:
          - main: mydomain
            sans:
            - "*.mydomain"

    # Add the service
    services:
      nodered:
        loadBalancer:
          servers:
          - url: http://192.168.1.185:1880/
          passHostHeader: true

regards
Steve

Hey @stevegroom,

Traefik Hub does not use the configuration of Traefik Proxy :smile: .
Traefik Proxy, Traefik Hub and all the services you want to connect to (with Hub) need to be on the same network and Hub needs a port to connect to.

This is not possible with Docker Host Networking.

Also, please be VERY careful with Host Networking, this is security wise potentially dangerous.