Commit Graph

8 Commits

Author SHA1 Message Date
jangko 3a0834943d
fixes copyright header in each .nim file 2021-06-20 11:28:38 +07:00
jangko a96a123bfe
fixes related to extensions
- set RSV bits in frame.encode
- move ExtParams from extutils.nim to types.nim
- remodel extension factory type
- accept/reject extensions offer in server
- offer/accept extensions in client
2021-06-15 21:34:38 +07:00
andri lim f80278aeee
implement frame reader for buffered payload (#55)
now the frame can choose to read from buffered
payload if available or read from asyncstream
if the buffer is empty
2021-06-14 13:41:31 -06:00
Dmitriy Ryajov 3e1599d790
Fix partial frame handling and allow extensions to hijack the flow (#56)
* moving files around

* wip

* wip

* move tls example into server example

* add tls functionality

* rename

* rename

* fix tests

* move extension related files to own folder

* use trace instead of debug

* export extensions

* rework partial frame handling and closing

* rework status codes as distincts

* logging

* re-enable extensions processing for frames

* enable all test for non-tls server

* remove tlsserver

* remove offset to mask - don't think we need it

* pass sessions extensions when calling send/recv

* adding encode/decode extensions flow test

* move server/client setup to helpers

* proper frame order execution on decode

* fix tls tests
2021-06-11 14:04:09 -06:00
Dmitriy Ryajov e632202037
wip: modeling extensions api (#48) 2021-06-01 14:24:00 -06:00
Dmitriy Ryajov 64da1a4344
Rework http (#38)
* wip

* wip

* move http under ws folder

* use asyctest

* wip

* wip

* rework response sending

* make example work with latest changes

* wip request/response

* misc

* fix example to use new http layer

* pass tls flags to client

* more cleanup

* unused imports

* more unsused imports

* better headers

* add helpre sendError

* export sendError

* attach selected proto to session

* move proto to session

* handle unsupported version

* fix tests

* comment out for now

* fix utf8 tests

* allow tests to be ran in tls

* misc

* use Port type

* add tls flags

* better api

* run tls tests

* fix tests on windows

* allow running tests with tls

* mic

* wip

* fix autobahn ci

* handle close

* cleanup

* logging and error handling

* remove old stream
2021-05-31 20:39:14 -06:00
andri lim 90c664545d
implement UTF8 handling (#35)
* implement UTF8 handling

or to be precisely, we add UTF8 validator which main duty
is to detect malformed UTF8 sequence using a fast DFA UTF8
decoder.

also enable autobahn UTF8 category tests, much more green :)

fixes #13

* fixes case 7.5.1 Send a close frame with invalid UTF8 payload

* add tests for validateUTF8

- tests for validateUTF8 in raw mode
- tests for validateUTF8 in websocket client/server
2021-05-28 10:47:24 -06:00
Dmitriy Ryajov eb62ec1725
Extract session (#31)
* extract websocket session

* fix tests

* fix frame tests
2021-05-25 16:39:10 -06:00