Josiah Bull
1c657d4c6a
feat: switched response type from Vec<u8> to Option<Vec<u8>> to allow returning of differentiation of no body from empty body.
2 years ago
Josiah Bull
36ab770059
feat: error type returns `Vec<u8>` instead of `Option<String>`
2 years ago
Florian Uekermann
3e45100f5d
replace unwrap with ?
3 years ago
Daniel Abramov
6c4d2bab04
Fix newly introduced clippy warnings
3 years ago
Dominik Nakamura
f4bb653aa0
Upgrade to rustls 0.20
3 years ago
Maarten de Vries
96612748d1
Expose `handshake::derive_accept_key` as public API.
4 years ago
WiredSound
98377cf3dd
Rename ProtocolErrorType to just ProtocolError, implement using thiserror
4 years ago
WiredSound
aaebb432f0
Fix clippy warnings
4 years ago
WiredSound
6f846da0e3
Add protocol error types
4 years ago
Dominik Nakamura
82e09ea025
Remove remaining dynamic dispatch usage
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
Daniel Abramov
96d9eb75e5
chore: apply `fmt` to the whole project
4 years ago
Daniel Abramov
a8e06d2b39
clean up http error handling
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
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".
5 years ago
macpp
0bfc217cfc
allow firefox to connect
5 years ago
Sebastian Dröge
c2f713b6bb
Update to http 0.2
5 years ago
Sebastian Dröge
88760b8b59
Fix various clippy warnings
5 years ago
Sebastian Dröge
07d4721ffd
Add type aliases for Response/Request with a fixed body type
...
Simplifies correct usage of the API.
5 years ago
Sebastian Dröge
1ecc4f900d
Use Response for the server handshake callback too
...
And add a public create_response(&Request) function that creates an
initial response. This can be used to simplify integration into existing
HTTP libraries.
5 years ago
Sebastian Dröge
09a9b7ceef
Remove custom Request/Response types from server code
...
Fixes https://github.com/snapview/tungstenite-rs/issues/92
5 years ago
Sebastian Dröge
9020840f84
Remove custom Request/Response types from client code
...
Fixes https://github.com/snapview/tungstenite-rs/issues/92
5 years ago
Sebastian Dröge
38a7d1a375
Remove custom Headers type and use http::HeaderMap instead
...
Fixes https://github.com/snapview/tungstenite-rs/issues/92
5 years ago
Danilo Bargen
5f3f4c016e
Fix typo in docs
5 years ago
Danny Browning
02684b4946
Try removing unpin
6 years ago
Danny Browning
614a5068fa
Tokio-Tungstenite Async Changes
...
Changes required for tokio-tungstenite async implementation.
6 years ago
Artem Vorotnikov
cbf80ecc76
Edition 2018, formatting, clippy fixes
6 years ago
Alexey Galakhov
6f132208ee
server: let callback return HTTP error messages
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Daniel Abramov
00303fa60c
Make the websocket configurable
7 years ago
Sean Schwartz
66d2c15f2d
Derive Debugs
...
Deny missing debug and resolve resulting errors to satisfy:
https://rust-lang-nursery.github.io/api-guidelines/debuggability.html#all-public-types-implement-debug-c-debug
Requires updated input_buffer pushed to crates.io:
- Resolved build errors by using github version of code until new version available on crates.io
Upgrade env_logger dev-dependency to v0.5.3
- Removed unwrap call from env_logger::init() as it is no longer needed.
7 years ago
Alexey Galakhov
3091d11566
callback static dispatch
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Daniel Abramov
44a15c9eab
Implements #6 (client/server headers access)
8 years ago
Daniel Abramov
f34c488217
Add basic support for examining headers ( #6 )
8 years ago
Alexey Galakhov
6faf90cd7b
trivial: remove commented-out code
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
bd9ac9673e
chore: cleanup docs and warnings, strict docs
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Ran Benita
76e80ca9a3
Only allocate error message if the error occurred
...
Suggested by clippy:
warning: use of `ok_or` followed by a function call
--> src/handshake/server.rs:20:19
|
20 | let key = self.headers.find_first("Sec-WebSocket-Key")
| ___________________^ starting here...
21 | | .ok_or(Error::Protocol("Missing Sec-WebSocket-Key".into()))?;
| |_______________________________________________________________________^ ...ending here
|
= note: #[warn(or_fun_call)] on by default
help: try this
| let key = self.headers.find_first("Sec-WebSocket-Key").ok_or_else(|| Error::Protocol("Missing Sec-WebSocket-Key".into()))?;
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#or_fun_call
8 years ago
Alexey Galakhov
53aa24b06b
Fix warnings
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
9e00140e19
trivial: debug logging cleanup
8 years ago
Alexey Galakhov
c6d3dd6404
refactor: fix unit tests for new API
8 years ago
Alexey Galakhov
b7557f1baa
refactor: make handshake completely async
8 years ago
Daniel Abramov
93843a1290
Fix `WouldBlock` error handling for the handshakes
8 years ago
Alexey Galakhov
7dccc51277
server: implement server
8 years ago
Alexey Galakhov
e63f594a14
Initial commit, mostly working client
8 years ago