Subject: | compatibility with ss5 server |
I don't think this is actually a bug, but a little enhancement.
I'm using ss5(http://ss5.sourceforge.net/) as my SOCKS5 server, and
Net::SOCKS as its connection client. But there's a little difference
between them in dealing with SOCKS request packet, which makes it
impossible to make them communicate with each other.
ss5 reads request TCP packet just once, but Net::SOCKS sends the request
into two separate TCP packets. (Net/SOCKS.pm line 418~419)
If Net/SOCKS.pm is tuned just a little like below, I think the
compatibility problem would disappear. I don't think it's Net::SOCKS's
bug, but PERL is much easier and clearer to modify than C anyway. :-)
BEFORE: (line 418~419)
Show quoted text
> print { ${*self}{fh} } pack ('CCCC', 5, $req_num, 0, $addr_type);
> print { ${*self}{fh} } $dest_addr . pack('n', ${*self}{peer_port});
AFTER:
Show quoted text> print { ${*self}{fh} } pack ('CCCC', 5, $req_num, 0, $addr_type),
$dest_addr . pack('n', ${*self}{peer_port});