Configure TCP whoamitcp

Hi !
I'm trying to get up my first traefik server.
Https works and the basic configuration works.

Now, I want a tcp redirect but i'm not able to understand how it works.
I'm a little newbie in the network world.
I've tried this :

version: "3.3"

    image: "traefik"
      - --entrypoints.web.address=:80
      - --entrypoints.websecure.address=:443
      - --entrypoints.autre.address=:8080

      - --providers.docker
      - --api
      - --certificatesresolvers.leresolver.acme.caserver=
      - --certificatesresolvers.leresolver.acme.httpChallenge.entryPoint=web
      - "80:80"
      - "443:443"
      - "8080:8080"
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "./acme.json:/acme.json"
      # Dashboard
      - "traefik.http.routers.traefik.rule=Host(``)"
      - "traefik.http.routers.traefik.service=api@internal"
      - "traefik.http.routers.traefik.tls.certresolver=leresolver"
      - "traefik.http.routers.traefik.entrypoints=websecure"
      - "traefik.http.routers.traefik.middlewares=authtraefik"
      - "traefik.http.middlewares.authtraefik.basicauth.users=user:$$apr1$$q8eZFHjF$$Fvmkk//V6Btlaf2i/ju5n/" # user/password
      # global redirect to https
      - "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
      - "traefik.http.routers.http-catchall.entrypoints=web"
      - "traefik.http.routers.http-catchall.middlewares=redirect-to-https"

      # middleware redirect
      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"

    image: containous/whoami
      - "``)"
      - ""
      - ""
      - ""
      - ""
      - "traefik.http.middlewares.auth.basicauth.users=user:$$apr1$$q8eZFHjF$$Fvmkk//V6Btlaf2i/ju5n/" # user/password

    image: containous/whoamitcp
      - "``)"
      - ""
      - ""
      - ""

      - ""
      - ""

I've downloaded packet sender to send tcp paquets to my server. And I receive "unable to connect".
In my dashboard, everything is ok.

What I suppose to get back on my screen if TCP paquet success ?
My config is ok ?

Thanks for your help !

UP !

Do you have any ideas how to test TCP connection and any basic configuration to create my first TCP container ?

Thanks :slight_smile:

tcp connections are typically used by software, and said software ususally have client and server components, which allows the client to connect to server that listens to incoming tcp connection. To test the connection you should be using the client corresponding to your server.

For example for a web server, you will use a web browser, for Microsoft Sql Server you will use Microsoft Sql Server Management Studio, or sqlcmd, For sshd you will use ssh, etc.

A generic way to see if server accepts tcp connections is to use telnet or netcat (nc).

Thanks you for your reply !

But I don't really success.
I'm triing tcp connexion with whoamitcp :
And I have nothing to output...

netcat whoamitcp.???? 25565 
HTTP/1.1 400 Bad Request
Content-Type: text/plain; charset=utf-8  
Connection: close                                                                                                                                                                                                                               400 Bad Request

Why http ?

I'm a little lost :smiley:

It's hard to tell, because it seems you obfuscated the domains in one way in your config and in a different way in this examlpe above.

What it amounts to that your url seems to be matched by http(s) router and not by the tcp one, you will need to double check the matching rules.

Same issue here - how to debug route matching in Traefik 2.2?


Dashboard and debug log. If you have problems post your configs and logs and describe what's not working.