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

Can you use the same ports as http app? #77

Open
ledlamp opened this issue Oct 14, 2022 · 3 comments
Open

Can you use the same ports as http app? #77

ledlamp opened this issue Oct 14, 2022 · 3 comments

Comments

@ledlamp
Copy link

ledlamp commented Oct 14, 2022

Or does this "app" work completely separate to the "http" app?

@mholt
Copy link
Owner

mholt commented Oct 14, 2022

It needs to use a different port, otherwise there's contention: who accepts connections, the HTTP server or the TCP server? I guess both could technically share the listener, but then it'd be random and you'd have undefined behavior.

So you'd probably want to use this app and then proxy to the HTTP app depending on the routes you define.

There's a pull request open in Caddy to make it possible to pipe a connection from one module to another, without needing to do any proxying. That will be cool I think!

What is your use case? Telling me specific details about what you're trying to do will help me design and implement a more useful feature.

@ledlamp
Copy link
Author

ledlamp commented Oct 14, 2022

I was interested in running a TLS-passthrough proxy for i.e. Signal etc. But it has to run on 443 and I already have caddy there with lots of layer 7 proxies and file servers. I was hoping it could have been a simple addition without affecting the l7, but they have to be integrated for that.

If this caddy app works separately then I might as well use a completely separate program like haproxy in front. I guess this module could be used so http app can get client ip address from haproxy. But haproxy supports l7 so I might as well do all my basic l7 proxying directly from that as well.

So yeah, it sounds like that PR will be important to bring caddy up to par with haproxy and nginx etc, which can handle both l7 and l4 together. Otherwise, I don't see much value in this module 🤷‍♂️

@WeidiDeng
Copy link
Contributor

@asdfisdffdg Can you try this branch, which added the ability to configure l4 as a caddy listener wrapper.

You have to write json config and http app must disable https though. If you want any help with configuration, @me and I'm glad to 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

3 participants