Skip to content

Question about setting up #17

@gymnae

Description

@gymnae

Hi there, I'd love to use the layer4 app without giving up on the Caddyfile, since it's YAMLness makes it easy for me to configure.
Could your layer4 extension be used for the following scenario:

caddy server running as docker container, listening on 0.0.0.0443/tcp and 0.0.0.080/udp and 0.0.0.0:443/udp and 0.0.0.0:80/udp

  1. Proxy turn.domain.tld UDP & TCP traffic received and sent on port 443 in raw form to a docker container running on port 3389 (requires also tls)
  2. Proxy vpn.domain.tld wireguard UDP traffic received and sent on port 443 to a docker container listening on the typical wireguard port (no tls required)
    Proxy other UDP traffic received with further sub-domains to other containers

(all docker containers share the same docker network, so they can be reached via local IP or DNS)

And leave the http reverse proxies as they are already defined?

Could something like this work:

        https_port 443
        http_port 80
        servers tcp/:443 {
                }
        layer4 {
               udp/:443 {
       turn.domain.tld {
               tls
               proxy {
                       to udp/signaling_coturn:3389
               }
        }
       vpn.domain.tld {
               tls
               proxy {
                       to udp/wireguard:51820
               }
        }
        sub.domain1.tld, sub.domain2.tld, sub.domain3.tld, sub.domain4.tld {
               tls
               proxy {
                       to udp/dnsproxy:853
               }
        }
               }
        }
        # normal http servers
sub.domain.tld {
...

When trying with

        servers tcp/0.0.0.0:443 {
                protocols h1 h2
        }
        layer4 {
               udp/0.0.0.0:443 {

I get the following warning:
"layer4 app module: start: listen udp 0.0.0.0:443: bind: address already in use"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions