Skip to content

Conversation

@mokeyish
Copy link

@mokeyish mokeyish commented Mar 2, 2024

Some codes will check the length of bytes sent. If the length of socks5's header is included, the verification will fail.

let bytes_size = Self::get_buf_size(addr.size(), buf.len());
let bytes = Vec::with_capacity(bytes_size);
async fn write_request(buf: &[u8], addr: AddrKind) -> Result<(Vec<u8>, usize)> {
let header_size = Self::get_header_size(addr.size());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get header size just via cursor like it done in read_response

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants