-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
afa78d7
update introduces a bug
#233
Comments
Oh, thanks for opening an issue. Maybe @WeidiDeng can look at it when he has a chance |
I thought about this case before. Sometimes there's a fallback route that doesn't require any matchers. You need to add another sni matcher in this case. Here is the detailed explanation: Before, caddy-l4 let the connection go through the matchers one by one. If one matcher blocks, the rest of the matchers won't run. f049165 made the matching async so when a matcher can't block matching because there isn't enough data. However, the initial implementation assumes the client will first send some data that can be used for matching, and it breaks some of the most simple use cases, i.e. packet forwarding without any matchers, #212, 228. pr 229 will introduce the same behavior. So now, all connections will go through the matcher loop without being read from. And in your case, the fallback route doesn't require any matcher, so it's selected by default. And the connection is not given a chance to be read. Honestly, I don't know what's best to do in this case. If users want to multiplex different kinds of connections, the matchers should be made explicit. |
@WeidiDeng To be precise, do you mean the Caddyfile above has to be adjusted in the following way?
I didn't really got the point about the fallback routes. In which cases will they work? Or have we completely dropped the fallback routes support as a part of afa78d7? It would be great if you could share some Caddyfile examples to illustrate your vision. |
What I mean about fallback routes is in the Caddyfile that matches all connections not matched by @vnxme The modification is correct. |
@WeidiDeng After reading your explanation and the official
Problem solved, thanks! |
@WeidiDeng @mholt |
I see. So if server speaks first in some protocols, it will still break if trying to multiplex this type of protocols with other protocols that clients sends data first. But then people shouldn't try to multiplex in this case. Is that right @ydylla ? |
Yes, mixing server speaks first and matching on client sent data is not really possible. We can not distinguish if the client did not send enough data yet or will never do so because the server speaks first. Maybe with some complicated timeout code, but that would also always artificially delay the server speaks first path. I think this was never possible with layer4 even with the old matching code. |
(Sorry been slow to reply!) Server-speaks-first protocols are something I hadn't considered. I guess if we try calling If that's the case, maybe we need to advise against the use of matchers with server-speaks-first protocols in the documentation. |
afa78d7
This update introduces a bug that causes
SNI configuration
to not work properly again, specifically theabc.caddy
website cannot be accessed, the complete example is as follows:Note:
abc.caddy
supports HTTPS and HTTP/2.def.caddy
supports HTTPS, HTTP/2, and HTTP/3.The text was updated successfully, but these errors were encountered: