-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add ReadyState, fix is_websocket_upgrade and add tests #194
Conversation
I'll try to add some tests... |
Codecov Report
@@ Coverage Diff @@
## master #194 +/- ##
===========================================
- Coverage 72.93% 26.29% -46.64%
===========================================
Files 33 33
Lines 1740 1734 -6
===========================================
- Hits 1269 456 -813
- Misses 471 1278 +807
Continue to review full report at Codecov.
|
f1e449c
to
ee2067c
Compare
I can't get the test to pass. This might be beyond my skill level 😭 The first two tests pass on the local WS server, but when I try to write from a WS to IOBuffer, it hangs. Even |
I don't see any place in the code where a socket is ever actually closed... |
I'm playing with the idea of changing:
and
where
This is from the old WebSockets.jl. Since I (we?) are trying to support both client and server, we need some way to avoid bouncing close messages back and forth. If one side is in a Any thoughts? |
I made some progress in the latest commit. 2 of 3 tests pass, but I'm still having some difficulty getting `
to work properly with the local WS server. I'm also getting
and haven't been able to track it down yet. |
495c372
to
7bd1949
Compare
7bd1949
to
6f5d7be
Compare
#197 would make this moot 🙏 |
is_websocket_upgrade(r::HTTP.Message) = | ||
(r isa HTTP.Request && r.method == "GET" || r.status == 101) && | ||
HTTP.hasheader(r, "Connection", "upgrade") && | ||
HTTP.hasheader(r, "Upgrade", "webscoket") | ||
HTTP.hasheader(r, "Upgrade", "websocket") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops!
Thankyou :)
|
||
close(io) | ||
p = 8000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added these tests 2cea2f7
👍 |
Sorry! My bad 😅
I copy / pasted your suggestion (including a typo) without checking 😅