Skip to content

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

Description

@wez

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<SocksV5Command> 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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions