Add SocksV5Command::Other(u8) to allow for extension requests
- Langage dominant
- Rust
- Étoiles
- 19
- Forks
- 2
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
I'm working up some changes to this effect in my fork; I'd prefer to merge them back here if you are amenable.
The high level outline is as below; the names and so on can be tweaked to match your preference.
* Add `SocksV5Command::Other(u8)`
* `SocksV5Command::from_u8` continues to return `Option` and return only RFC 1928 commands, so that `read_request` continues to have the same semantics wrt. rejecting unknown commands.
* Add `SocksV5Command::from_any_u8(u8) -> SocksV5Command` that will populate `Other` for values outside of RFC 1928
* Add `read_request_impl(reader: Reader, allow_extensions: bool)` that can opt-in to using `SocksV5Command::from_any_u8`.
* Adjust `read_request` to call through to `read_request_impl` to avoid duplicating the logic
I've tried to avoid making backwards-incompatible API changes in the above, but if you prefer, `SocksV5Command::from_u8` could be renamed to `SocksV5Command::from_rfc1928(u8)` to more closely indicate its underlying action/effect and so on.
Is this something that you'd be interesting in merging? I'll send a PR if that is ok!
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.