Commit Graph

10 Commits

Author SHA1 Message Date
Jacek Sieka e974acbe0a
test fixes (#115)
* don't use global for server instance
  * it gets shared between tests and causes gcsafe to trigger
* enable `chronosStrictException` in tests
* avoid asynctests dep
* testcommon -> all_tests (like the other projects)
2022-06-20 09:19:38 +02:00
Tanguy 908632aa07
Fix for styleCheck:usages (#96) 2021-12-27 11:27:21 +01:00
Mark Spanbroek e974a866b6 Update to latest asynctest, with unittest2 support
Also fixes a number of GcUnsafe2 warnings,
by placing var declarations inside the suite.
2021-09-21 09:35:12 +02:00
Dmitriy Ryajov 0ec755738c
Perform utf-8 validation at message boundaries (#90)
* validate utf8 at the message level

* move utf-8 validation to message

* rename `recv` to `recvMsg`

* add partial frame validation tests

* use `recvMsg` instead of `recv`
2021-08-04 10:23:56 -06:00
Dmitriy Ryajov 06ae75cf7f
add support for DNS resolution (#81)
* add support for DNS resolution

- reworked API to be more consistent
  - string addresses and Uri types will be now resolved
- made the API more consistent

* log failed connection attempt

* agent string can't contain spaces

* add websock topic (#83)

* style

Co-authored-by: Tanguy Cizain <tanguycizain@gmail.com>
2021-07-14 18:51:39 -06:00
jangko b3c60bbd4e
rename nim-ws to nim-websock 2021-06-29 08:50:29 +07:00
jangko 88e99ff028
fixes failing utf8 test case
it was a buggy test case, not related to windows
but by chance discovered on windows.
2021-06-12 13:39:24 +07: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 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