alexkirsz / alexkirsz/socksv5

Add SocksV5Command::Other(u8) to allow for extension requests

Đang mở
#12 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
19
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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!

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.