Open moteus opened 9 years ago
SV1, RSV2, RSV3: 1 bit each
MUST be 0 unless an extension is negotiated that defines meanings
for non-zero values. If a nonzero value is received and none of
the negotiated extensions defines the meaning of such a nonzero
value, the receiving endpoint MUST _Fail the WebSocket
Connection_.
ok. but this implementation does not support extensions yet. further, we are not processing the rsv values... how can the autobahn test suite check this?
Autobahn server send messages with setted rsv and client must close connection with 1002 status
Ok. I don't see that the connection is closed when rsv != 0. Can we add this test to the Travis file?
May be we can use autobahn server. The only problem is I do not know how detect test fail.
To run testcase for RSV you can use wstest -m fuzzingserver -s rsv-config.json
with config like
{
"url": "ws://127.0.0.1:9001",
"outdir": "./reports/clients",
"cases": ["3.*"],
"exclude-cases": [],
"exclude-agent-cases": {}
}
My test runner is https://github.com/moteus/lua-lluv-websocket/blob/master/test/autobahn_client_test.lua
interesting. i'd like to integrate that somehow.
anyways, shouldn't there be a check for rsv bytes and eventually a connection close?
shouldn't there be a check for rsv bytes and eventually a connection close?
websocket implementation should check RSV and if it not 0 then it should start close handshake with status 1002.
I do not know how extensions works but it is valid for client without extenstions.
So my lluv websocket in this case send protocol error and return WEBSOCKET.EOF error to client code. So this logic need to be inplemented in client/server code.
Current implementation do not do this and it could work in real world but to provide ability to fix this websockets-core
part should returns this bits.
I just make commit to run autobahn tests on Travis for lluv-websocket. Without this PR tests 3.* are failed.
:+1:
but still: we should integrate that test using the "official" api and auto-close the connection as you do in your lluv autobahn test client.
Please take a look to autobahn_wclient_test. It uses pablic client API.
You just need remove SSL parts and replace uv.run()
call.
To run test you need first run run wstest
wstest -m fuzzingserver -s rsv-config.json
with config like
{
"url": "ws://127.0.0.1:9001",
"outdir": "./reports/clients",
"cases": ["3.*"],
"exclude-cases": [],
"exclude-agent-cases": {}
}
why should we read out the reserved if they carry no info at all?