Maarten de Vries
96612748d1
Expose `handshake::derive_accept_key` as public API.
4 years ago
WiredSound
79dcf9f77c
Use matches! macro in tests
4 years ago
WiredSound
3e485ddb96
Rename UrlErrorType to just UrlError, implement using thiserror
4 years ago
WiredSound
98377cf3dd
Rename ProtocolErrorType to just ProtocolError, implement using thiserror
4 years ago
WiredSound
652a6b776e
Rename CapacityErrorType to just CapacityError, implement using thiserror
4 years ago
WiredSound
e6d66698a3
Use thiserror to streamline the implementation of the main Error type
4 years ago
WiredSound
78d59f9266
Escape square brackets in doc comment
4 years ago
WiredSound
0b34bee94f
Add capacity error types
4 years ago
WiredSound
aaebb432f0
Fix clippy warnings
4 years ago
WiredSound
6f846da0e3
Add protocol error types
4 years ago
WiredSound
34c6e63d87
Add specific URL error types
4 years ago
Dominik Nakamura
82e09ea025
Remove remaining dynamic dispatch usage
4 years ago
Antoine Catton
208061ba28
Docfix: mio::tcp has been renamed to mio::net in its latest version ( #164 )
...
This a relic of the old name in the function documentation.
4 years ago
Austaras
4d70f63cbf
Add a custom response builder ( #158 )
...
* add custom reponse builder
* change names and shorten implemtation
* Re-format the code
Co-authored-by: Daniel Abramov <dabramov@snapview.de>
4 years ago
Constantin Nickel
8417078ef3
Update to bytes 1.0
4 years ago
Adam Bezecny (DHL IT Services)
c8c236056b
if streamlined
4 years ago
Adam Bezecny (DHL IT Services)
2e55ed0fcc
comment streamlined
4 years ago
Adam Bezecny (DHL IT Services)
9f292d21fc
minor fixes
4 years ago
Adam Bezecny (DHL IT Services)
4f7dab5d7b
documentation for server_allow_unmasked improved
4 years ago
Adam Bezecny (DHL IT Services)
a9adb42343
server_allow_unmasked changed from Option<bool> to bool
4 years ago
Adam Bezecny (DHL IT Services)
0121bf9682
WebSocketConfig extended to allow accepting unmasked client frames
4 years ago
Daniel Abramov
fcacea7c9f
chore: apply `clippy`
4 years ago
Daniel Abramov
96d9eb75e5
chore: apply `fmt` to the whole project
4 years ago
Daniel Abramov
09f5d34899
use 3 redirects as default for `connect`
4 years ago
Daniel Abramov
a8e06d2b39
clean up http error handling
4 years ago
Daniel Abramov
521f1a0767
clean up the redirect logic a bit
4 years ago
Redrield
60f7b0f024
Fix some code-review issues
...
* Replace Redirection error with a general Http error that owns the
response
* Make the default client connect function iterative instead of
recursive
* Add a limit to the amount of redirects a client will attempt to
perform
4 years ago
Redrield
6bce14fa26
Add facilities to allow clients to follow HTTP 3xx redirects
...
* The connect() function defined in this crate will automatically follow
redirecting responses.
* Adds Error::Redirection, which is a special case of Error::Http that
extracts the redirection target from the response headers, and stores it
in the error object. Client implementations that build upon tungstenite
can use this to implement redirecting.
* A catch-all solution for redirects is not possible due to the
abstraction transforming socket types to Read + Write, implementations
that use the client_* methods need to handle redirections themselves.
4 years ago
Horki
88ff5f371f
matches!: use macros; remove unused imports
4 years ago
philipp
50bc1b5e90
Delegate into_client_request (4)
4 years ago
philipp
064fd9313f
Delegate into_client_request (3)
4 years ago
philipp
90345c994a
Delegate into_client_request (2)
4 years ago
philipp
4cdc2edab1
Delegate into_client_request
4 years ago
philipp
599b677f5a
Avoid temporary variable `fin`
4 years ago
Redrield
bcf2b22d9e
Deduplicate the reason line in HTTP responses
...
The impl of Display for StatusCode already includes the canonical reason
if it exists. The current implementation duplicates this (e.g. the
status line will read "101 Switching Protocols Switching Protocols", or
"400 Bad Request Bad Request".
4 years ago
Sebastian Dröge
849f248a94
Update to sha-1 0.9
4 years ago
Evgeniy A. Dushistov
5a95f12c6d
refactoring/apply_mask: reduce number of usage of unsafe to 1
...
Plus it should be faster now:
apply_mask/fallback/0 time: [24.282 ns 24.727 ns 25.255 ns]
apply_mask/fast/0 time: [11.921 ns 11.963 ns 12.011 ns]
apply_mask/fast_safe/0 time: [7.9340 ns 7.9807 ns 8.0261 ns]
apply_mask/fallback/1 time: [25.284 ns 25.710 ns 26.124 ns]
apply_mask/fast/1 time: [20.433 ns 20.476 ns 20.511 ns]
apply_mask/fast_safe/1 time: [9.3208 ns 9.3833 ns 9.4470 ns]
apply_mask/fallback/2 time: [16.051 ns 16.160 ns 16.275 ns]
apply_mask/fast/2 time: [20.564 ns 20.569 ns 20.574 ns]
apply_mask/fast_safe/2 time: [9.1449 ns 9.1830 ns 9.2189 ns]
apply_mask/fallback/3 time: [15.386 ns 15.548 ns 15.715 ns]
apply_mask/fast/3 time: [18.836 ns 18.867 ns 18.917 ns]
apply_mask/fast_safe/3 time: [8.3092 ns 8.3566 ns 8.4076 ns]
5 years ago
Evgeniy A. Dushistov
9764ac13a1
infra/apply_mask: test more case for apply_mask
...
make sure that input with len 0,1,2,3 also tested
5 years ago
Evgeniy A. Dushistov
de80b9bced
Change Into to From for CloseCode to u16 conversation
...
As stated in standard library documentation:
> One should always prefer implementing From over Into because implementing From automatically
> provides one with an implementation of Into thanks to the blanket implementation in the standard library.
And this provides the way to use u16::from(close_code)
5 years ago
kids300
fb83e8c791
rm to_string
5 years ago
Yan
16a33df195
fix ws subportocol lowercase header
5 years ago
Mike Pedersen
1f744f1548
Make mask public on FrameHeader
...
Without the ability to get the mask, having the `FrameHeader` struct as a public type along with functions like `parse` is somewhat useless. I can't see any reason why it shouldn't be public.
5 years ago
Daniel Abramov
0c429cba94
chore: remove deprecated `description()`
...
Fixes #111
5 years ago
Naja Melan
9c48226c8f
chore: Remove needless closing/opening of the impl block on WebSocketContext.
5 years ago
Naja Melan
1f407f1005
feat: Allow reading the configuration.
...
This allows wrapper types to correctly split data before creating websocket
messages, guaranteeing to respect the max size.
Notably when the WebSocket is provided by user code.
5 years ago
Naja Melan
d17f749914
doc: be precise about max message sizes.
...
If preferred to avoid abbreviations, it could be called mebibytes.
5 years ago
macpp
0bfc217cfc
allow firefox to connect
5 years ago
Alexey Galakhov
6b3423292f
trivial: fix clippy warning
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
5 years ago
Alexey Galakhov
85f211230a
websocket: add `can_read()` and `can_write()`
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
5 years ago
Alexey Galakhov
da3acc107e
protocol: handle "Connection reset by peer" in closing state
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
5 years ago