Commit Graph

19 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
jangko a60dbd5dc9
fixes required to allow autobahn client works
- send requestUrl.query in client.nim
- fixes genMaskKey bug in utils.nim
- using Base64Pad instead of Base64 in `connect` proc
- add `host` field to request HTTP header in `connect` proc
- add missing `secure` param in `connect` proc

fixes #32
2021-06-12 13:51:50 +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 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
Dmitriy Ryajov eb62ec1725
Extract session (#31)
* extract websocket session

* fix tests

* fix frame tests
2021-05-25 16:39:10 -06:00
Dmitriy Ryajov 0f48b62eb9
Fix tlsclient (#30)
* fix npe in handshake

* fix tls client
2021-05-25 15:00:53 -06:00
Dmitriy Ryajov 5d0bcf6375
Client server (#29)
* better client/server separation (WIP)

* add extensions interface

* index out of bounds
2021-05-25 08:02:32 -06:00
Dmitriy Ryajov 0a4121c29d
Fix first frame (#28)
* split out frame

* use new api

* fix import
2021-05-24 18:47:27 -06:00
Dmitriy Ryajov 352bb6b3a4
use binary flag 2021-05-22 03:09:28 -06:00
Arijit Das 1b3e47d2f5
Add support for binary frame 2021-05-22 03:05:57 -06:00
Dmitriy Ryajov f37e4bb19a
Cleanup (#21)
* cleanup

* send payload with ping
2021-05-22 02:26:45 -06:00
Arijit Das f8cfcd1f99
Fix webscoket close and fix test cases. 2021-05-22 12:12:41 +07:00
Arijit Das 51d834a0a1
Fix webscoket close and fix test cases. 2021-05-22 12:12:31 +07:00
Arijit Das 6b76bd8261
WIP: Implement websocket TLS. (#7)
* Update http to use chronos http.

* Implement TLS in websocket.

* Add webscoket TLS test.

* Minor nit.

* Add TLS test file.

* Update http to use chronos http. (#6)

* Update http to use chronos http.

* Add stream.nim file.

* Address comments.

* Fix CI failure.

* Minor change.

* Address comments.

* Fix windows CI failing test.

* minor cleanup

* spacess

* more idiomatic connect

* use stew/base10

Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>

* Implement TLS in websocket.

* Minor nit.

* merge master

* wip

* Update http to use chronos http. (#6)

* Update http to use chronos http.

* Add stream.nim file.

* Address comments.

* Fix CI failure.

* Minor change.

* Address comments.

* Fix windows CI failing test.

* minor cleanup

* spacess

* more idiomatic connect

* use stew/base10

Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>

* Update http to use chronos http.

* Implement TLS in websocket.

* Minor nit.

* Update http to use chronos http. (#6)

* Update http to use chronos http.

* Add stream.nim file.

* Address comments.

* Fix CI failure.

* Minor change.

* Address comments.

* Fix windows CI failing test.

* minor cleanup

* spacess

* more idiomatic connect

* use stew/base10

Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>

* Implement TLS in websocket.

* Minor nit.

* add testing keys

* wip

* fix test

* wip

* remove eth dep and add skipdirs

* fix package structure

* fix deps

* check nim version

* Fix CI failure.

* Don't call `ws.stream.closeWait()`

* always close both ends to complete the sequence

* misc

* don't fail on close

* Fix windows CI.

* fix linux x86 builds

* use consistent connect pattern

* move keys to better place

* return dumbResponse

* small cleanup

Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
2021-04-13 16:05:58 -06:00
Arijit Das afb7e4d86e Fix package import 2020-12-01 18:53:27 +05:30
Arijit Das 22cefcfd4b Minor nit 2020-12-01 18:32:41 +05:30
Arijit Das 3b69187007 Implement web socket handshake 2020-12-01 18:13:59 +05:30