-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Caddy doesn't pass the "Connection" header to websockets? #886
Comments
Thanks for the report. Hmm, I'm not able to reproduce this using a simple echo server backend (the same example in the godoc) with the added line of Try pulling the latest and repeat the experiment maybe? As of right now though, the tests--which do cover websockets--are passing. If you are able to reproduce it I'll need more info. And please use Thank you! |
Proper version information built with
Same issue as before, websockets on proxies don't work because the |
@6f7262 Thanks for that; I need more information though.
So far on my end everything looks peachy... here I assume you are connecting to /stream:
|
@6f7262 I wonder, could you try the latest on master? I'm curious if a change for #916 affected this behavior at all. |
fyi: I can confirm that my setup works fine with both, 0.8.2 and 0.8.3. |
I'm still unable to reproduce this; everything works fine for me on 0.9. |
Hi, I created docker containers to reproduce the issue: https://github.com/evermax/caddy-websocket-test But it works for me. Can you give me some feedback as to how to get it closer to your own configuration? |
@evermax Thanks. Your test works for me on both 0.8.3 and 0.9. I followed your example to make a self contained test (though not as elegant). I went and forked Gorilla's websocket chat example which is the essence of what I'm using in my code. This example works fine for me on 0.8.3, but again it does not work for 0.9 (or current master). Gorilla gives me an error: If you'd like to try, you can try this: https://github.com/schollz/websocket-test. The Caddyfile I used is in there so you just need to do |
Master branch seems to work fine for me header-wise also. Websockets are slow to connect but that's another issue entirely. |
Okay, so @6f7262 , your original issue is resolved? Now we just have @schollz's lingering issue it seems? |
Sorry, my issue lingers. Just tried on Windows + Firefox/Chrome and still 0.8.3 works while 0.9 does not. Am I doing something wrong? Or am I just cursed? Feel free to close the issue if I'm the only one having problems. |
This is really great news, thanks @tw4452852 for taking the time to confirm! @evermax and @schollz I will close this now, but if there's anything to add feel free to do so. |
Brilliant! It works great now. Thanks @tw4452852, @mholt. |
@mholt Would it be possible to make |
Yes, 0.9.1 will include this fix. And thank you! |
(Are you asking for help with using Caddy? Please use our forum instead: https://forum.caddyserver.com. If you are filing a bug report, please answer the following questions. If your issue is not a bug report, you do not need to use this template. Either way, please consider donating if we've helped you. Thanks!)
1. What version of Caddy are you running (
caddy -version
)?Caddy (untracked dev build)
(master)2. What are you trying to do?
Proxy to a websocket
3. What is your entire Caddyfile?
4. How did you run Caddy (give the full command and describe the execution environment)?
./caddy
5. What did you expect to see?
Websockets being proxied correctly.
6. What did you see instead (give full error messages and/or log)?
The backend which is being proxied doesn't receive the header and therefore spits out
websocket: could not find connection header with token 'upgrade'
7. How can someone who is starting from scratch reproduce this behavior as minimally as possible?
Read the "Connection" header from a proxied backend, ensuring the request was a valid websocket one.
The text was updated successfully, but these errors were encountered: