TCP proxy using traefik 2.0

Hi everyone

My goal is to setup traefik 2.0 as TCP proxy to route 1:1 from one network to another.

I can access the webcam using the following url:
rtsp://user1:password1@192.168.90.200:55555/cam/realmonitor?channel=1&subtype=0

This traefik.toml config seems not to work for my use case:

[entryPoints]

  [entryPoints.wcam]
  address = ":55555"

[retry]

[api]

[tlsStore]
  [tlsStores.default]
    [tlsStores.default.defaultCertificate]
      certFile = "./data/default.crt"
      keyFile = "./data/default.key"

[providers]
  [providers.file]

[tcp]

  [tcp.routers]
    [tcp.routers.wcam]
      entrypoints = ["wcam"]
      rule = "HostSNI(`*`)"
      service = "wcam"
      [tcp.routers.wcam.tls]
        passthrough = true

  [tcp.services]
    [tcp.services.wcam]
      [tcp.services.wcam.loadbalancer]
        [[tcp.services.wcam.loadbalancer.servers]]
          address = "192.168.90.200:55555"

I would expect to be able to access the rtsp stream via IP of the proxy over port 55555.

Port 55555 is exposed on the proxy host.

Hi,

In order to have a working tcp proxy, you need to have a tcp.services too.
https://docs.traefik.io/v2.0/routing/services/#configuring-tcp-services

[tcp]
  [tcp.routers]
    [tcp.routers.wcam]
      entrypoints = ["wcam"]
      rule = "HostSNI(`*`)"
      service="wcam"

  [tcp.services]
    [tcp.services.wcam.loadbalancer]
    [[tcp.services.wcam.loadbalancer.servers]]
    address="192.168.90.200:55555"


Didn't you see the scrollbar of my code sample? :wink:

This does not work for me.

@james.dean: Did you manage to make it works? Im looking for some solution like you. Would you able to share if you made any progress? Many thanks!

Not yet, but will let you know if it will work one day :slight_smile:

I scrolled ( :smile: ) and it appears that you configured TLS on your router. Does your RTSP is really with TLS?

If you use TLS (even with a passthrough) in your configuration router, you need to use TLS.

Could you try without the TLS part in your router?