Trying to route two Terraria servers based on domain name using same port

My goal is to be able to use to get in first server, and in order to get into second. But using the :7777 port is always getting routed to the first image. It appears that the HostSNI is behaving like a wildcard.

        image: atgomez6555/terraria:tshock-latest
        container_name: terraria
            - 7777:7777
            - world=Avernus.wld
            - /home/alex/docker/terraria/config:/config
        tty: true
        stdin_open: true
        restart: unless-stopped
            traefik.enable: "true"
            traefik.tcp.routers.terraria.entrypoints: "terraria"
            traefik.tcp.routers.terraria.rule: "HostSNI(``)"
            traefik.tcp.routers.terraria.tls: "true"
            - traefik

        image: atgomez6555/terraria:tshock-latest
        container_name: terraria2
            - 7778:7778
            - world=The_Island_of_Silver.wld
            - /home/alex/docker/terraria/config2:/config
        tty: true
        stdin_open: true
        restart: unless-stopped
            traefik.enable: "true"
            traefik.tcp.routers.terraria2.entrypoints: "terraria"
            traefik.tcp.routers.terraria2.rule: "HostSNI(``)"
            traefik.tcp.routers.terraria2.tls: "true"
            - traefik

And this is my toml config file:

# [global]
  level = "INFO"

    address = ":80"
      to = "websecure"
      scheme = "https"

    address = ":443"

    address = ":8083"

    address = ":7777"

  providersThrottleDuration = "2s"
    swarmModeRefreshSeconds = "15s"
    exposedByDefault = false
    endpoint = "unix:///var/run/docker.sock"

  insecure = true
  dashboard = true

  # terminatingStatusCode = 0

      email = "xxxx"
      storage = "acme.json"
        provider = "cloudflare"
        delayBeforeCheck = "0s"
        resolvers = ["", ""]

Ideally I do not want to have to port forward a separate port for every server I run.

Well, SNI is a TLS concept, and games rarely use TLS for their connection (unless they use HTTP(S) as the protocol).

In short, what you are trying to achieve is impossible in principle.

Ok, I'm still trying to learn this. So 1 port per server running is pretty much a technical requirement? Thanks for the insight. At least I'm still able to give a name via proxy vs. having to use IP.

Yeah, there is no public information in the incoming connection that could help deduce which server it's intended for.

@atg22896 How do you do to connect the client of terraria through traefik?