Conversation
...ttp/src/main/java/io/aklivity/zilla/runtime/binding/http/internal/codec/Http2SettingsFW.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Please add a newline at end of file.
...t/java/io/aklivity/zilla/runtime/binding/http/internal/streams/rfc7540/client/ConnectIT.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
These scripts should move to rfc8441 directory.
...main/scripts/io/aklivity/zilla/specs/binding/http/streams/network/rfc7540/connect/server.rpt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Here we are just tracking the presence and count of the pseudo-headers, so they can be checked in decodeHeaders. So we likely need to add a count for protocol and include in the check.
Note we are validating the pseudo-headers themselves, not the values.
There was a problem hiding this comment.
I think I misread this part of the spec in rfc8441:
The :protocol pseudo-header field MUST be included in the CONNECT request, and it MUST have a value of websocket to initiate a WebSocket connection on an HTTP/2 stream
I now think it means that if we have a CONNECT request, before we create a websocket connection we must ensure that the request also contains the :protocol pseudo-header and it must have the value websocket.
Maybe we don't need to do any validation in the http2 binding in relation to a connect request.
There was a problem hiding this comment.
Until we find a better place for it, I have added a check to allow a :protocol pseudo-header in a CONNECT request which is otherwise not allowed by rfc7540. This seems to make sense to be in the http2 binding because the binding is always advertising the ENABLE_CONNECT_PROTOCOL setting.
There was a problem hiding this comment.
Agreed, just make sure you are doing the simple count here, and the enforcement in decodeHeaders, aligned with approach for other checks.
.../scripts/io/aklivity/zilla/specs/binding/http/streams/application/rfc7540/connect/client.rpt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Use http:matchBeginEx when reading, and only include the headers that matter per spec, such as :status above.
There was a problem hiding this comment.
If we are going with websocket handshake, then payload should either be omitted or follow websocket framing instead of Hello, world.
931ca9f to
a971c15
Compare
There was a problem hiding this comment.
I expect the first octet to be 0x81 for text but the server is returning 0x82 (binary). I couldn't find any tests that demonstrate receiving plain text from the engine.
There was a problem hiding this comment.
Given that text is a subset of binary, we default to binary to ensure correctness.
However, if WsDataEx on DATA frame has flags 0x81 then we send a text frame instead.
You can see this in action via ws.echo example. Sending a text frame causes a text frame to be echoed back, because the WsDataEx for the decoded text frame, is sent back from echo binding, and then ws binding encodes DATA as a text frame.
There was a problem hiding this comment.
Btw, missing newline at EOF.
jfallows
left a comment
There was a problem hiding this comment.
Btw, when you are done making the changes, please also test end-to-end using a local build with ws.echo example and changing values file to set the image tag to develop-SNAPSHOT, similar to mqtt.kafka.reflect example.
Looks like Chrome first shipped support for WebSocket over HTTP/2 in v91.
https://chromestatus.com/feature/6251293127475200
There was a problem hiding this comment.
Missing newline at end of file.
There was a problem hiding this comment.
Given that text is a subset of binary, we default to binary to ensure correctness.
However, if WsDataEx on DATA frame has flags 0x81 then we send a text frame instead.
You can see this in action via ws.echo example. Sending a text frame causes a text frame to be echoed back, because the WsDataEx for the decoded text frame, is sent back from echo binding, and then ws binding encodes DATA as a text frame.
There was a problem hiding this comment.
Instead of performing a UTF-8 decode to String then comparing to String constant, please create a DirectBuffer constant for HEADER_NAME_PROTOCOL and compare without the need for a decode.
Note: one easy way to create the right DirectBuffer constant is new String8FW(":protocol").value().
There was a problem hiding this comment.
Agreed, just make sure you are doing the simple count here, and the enforcement in decodeHeaders, aligned with approach for other checks.
There was a problem hiding this comment.
Given the vastly different approaches to the handshake, suggest you avoid all the if/else logic and instead have separate Ws11Server and Ws2Server, both extending generic abstract WsServer if there is enough overlap in implementation beyond the handshake.
e59a18c to
1671da6
Compare
967218e to
5821774
Compare
46b0f5b to
52782f6
Compare
52782f6 to
47abdac
Compare
squash
47abdac to
cab5a94
Compare
Description
Fixes # (issue)