caddy-ext icon indicating copy to clipboard operation
caddy-ext copied to clipboard

Specify host for layer4

Open Miggets7 opened this issue 1 year ago • 2 comments

Hi,

Is it possible to specify a host/domain for a service?

I'm using the caddy-docker-proxy module in combination with yours with this label:

labels:
        caddy.layer4.:27017.proxy: "{{upstreams 27017}}"

which generates this caddy part:

"layer4": {
      "servers": {
        "srv0": {
          "listen": [":27017"],
          "routes": [
            {
              "handle": [
                {
                  "handler": "proxy",
                  "upstreams": [{ "dial": ["10.0.22.76:27017"] }]
                }
              ]
            }
          ]
        }
      }
    }

But I would like to specify the host/domain, so I could have multiple services running on the same port. Is it possible?

Miggets7 avatar Aug 08 '23 18:08 Miggets7

Check out section 5 of this comment. It tries to multiplex HTTPS and SSH by having layer4 itself listen on 433. It uses SSH and SNI matchers along with the subroute handler; I'm not sure if caddy-ext/layer4 supports those.

arashsm79 avatar Aug 28 '23 22:08 arashsm79

@arashsm79 Not sure how the link should help me?

Miggets7 avatar Sep 18 '23 08:09 Miggets7