Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about setting up #17

Open
gymnae opened this issue Apr 20, 2023 · 2 comments
Open

Question about setting up #17

gymnae opened this issue Apr 20, 2023 · 2 comments

Comments

@gymnae
Copy link

gymnae commented Apr 20, 2023

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"

@gymnae
Copy link
Author

gymnae commented Apr 21, 2023

Created a topic in the caddy community forum related to my question: https://caddy.community/t/help-with-layer4-caddy2-ext-layer4-proxy-both-udp-and-tcp/19719

@RussellLuo
Copy link
Owner

Hi @gymnae, is there anything this plugin can help you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants