Help with Traefik and RTMP port

Hi,

I wrote a docker-compose to run OSP behind traefik. I managed to set up everything successfully and I can visit the site under the given domain. The problem is, I cannot start streaming because I am not sure how to setup the RTMP port correctly. Below are the docker-compose files I am using right now for the osp container and the traefik container. I left out some things which I think are not needed for this problem (for better readability) but can provide more infos if needed.

services:
  traefik:
    command:
      # Entrypoints (not HTTPS)
      - "--entrypoints.web.address=:80"
      # HTTPS (websecure entrypoint)
      - "--entrypoints.websecure.address=:443"
      # TS3 entrypoints
      - "--entrypoints.ts-udp.address=:9987/udp"
      - "--entrypoints.ts-tcp.address=:30033"
      # OSP rtmp entrypoints
      - "--entrypoints.osp-rtmp.address=:1935"
    labels:
      # Dashboard stuff
      - "traefik.enable=true"
      - "traefik.http.routers.traefik-https.rule=Host(`traefik.${DOMAIN}`)"
      - "traefik.http.routers.traefik-https.entrypoints=websecure"
      - "traefik.http.routers.traefik-https.middlewares=auth"
      - "[email protected]"
      - "traefik.http.routers.traefik-https.tls=true"
      - "traefik.http.routers.traefik-https.tls.certresolver=myresolver"
      - "traefik.http.middlewares.auth.basicauth.users=${TRAEFIK_USER}:${TRAEFIK_PASSWORD_HASH}"
      # http to https redirect
      - "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
      - "traefik.http.middlewares.https-redirect.redirectscheme.permanent=true"
      - "traefik.http.routers.http_catchall.rule=HostRegexp(`{any:.+}`)"
      - "traefik.http.routers.http_catchall.entrypoints=web"
      - "traefik.http.routers.http_catchall.middlewares=https-redirect"
    ports:
      # The HTTP port
      - "80:80"
      # The HTTPS port
      - "443:443"
      # TS3 ports
      - "9987:9987/udp"
      - "30033:30033"
      # OSP rtmp ports
      - "1935:1935"

  osp-app:
    depends_on:
      - osp-db
      - osp-redis
    container_name: osp-app
    entrypoint: ["/opt/osp/setup/docker/wait-for-it.sh", "osp-db:3306", "--strict", "-t", "60", "--", "/opt/osp/setup/docker/entrypoint.sh"]
    env_file: live.env
    environment:
      - DB_URL=mysql+pymysql://${MYSQL_USER}:${MYSQL_PASSWORD}@${MYSQL_HOST}:3306/${MYSQL_DATABASE}
    image: deamos/openstreamingplatform:latest
    labels:
        # Watchtower
        - "com.centurylinklabs.watchtower.enable=true"
        # Routes
        - "traefik.enable=true"
        - "traefik.http.routers.osp.entrypoints=websecure"
        - "traefik.http.routers.osp.rule=Host(`osp.${DOMAIN}`)"
        - "traefik.http.routers.osp.tls=true"
        - "traefik.http.routers.osp.tls.certresolver=myresolver"
        - "traefik.http.services.osp.loadbalancer.server.port=80"
        # RTMP specific
        - "traefik.tcp.routers.rtmpcast.entrypoints=osp-rtmp"
        - "traefik.tcp.routers.rtmpcast.rule=HostSNI(`osp.${DOMAIN}`)"
        - "traefik.tcp.routers.rtmpcast.service=rtmpcast"
        - "traefik.tcp.routers.rtmpcast.tls=true"
        - "traefik.tcp.routers.rtmpcast.tls.certresolver=myresolver"
        - "traefik.tcp.services.rtmpcast.loadbalancer.server.port=1935"
    networks:
        - default
    restart: unless-stopped
    volumes:
       - ${OSP_ROOT}/data:/var/www
       - ${OSP_ROOT}/data/nginx/conf:/usr/local/nginx/conf        

As the docker-compose shows, I set up a tcp router in the osp container. Traefik shows me that this is also working. But I cannot start streaming to osp. OBS always gives me the error that it cannot connect to the server.

Has anybody sucessfully set up OSP behind traefik and could help me with my issue or point me into the right direction?

Replying to myself because i kind of fixed my issue.

If anyone is interested they can check out my setup here:

With this setup I can stream to OSP but the stream is dropping and looping all the time so I think something is wrong with my traefik setup. Any help would be appreciated