Browse files

Removal of "\xF1\x00" preceeding packed IP address to permit connecti…

…ons to IP addresses. I'm certainly no expert in SOCKS5 protocol but this is closer to what the socksify gem does. Tested with OpenSSH and Tor.
  • Loading branch information...
1 parent 530892c commit f30d8e274887391016ad110510daf68d5ae27c55 @nferch nferch committed Apr 14, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/em-socksify/socks5.rb
View
2 lib/em-socksify/socks5.rb
@@ -18,7 +18,7 @@ def socks_send_connect_request
send_data [5, 1, 0].pack('CCC')
if matches = @socks_target_host.match(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/)
- send_data "\xF1\x00\x01" + matches.to_a[1 .. -1].map { |s| s.to_i }.pack('CCCC')
+ send_data "\x01" + matches.to_a[1 .. -1].map { |s| s.to_i }.pack('CCCC')
elsif @socks_target_host =~ /^[:0-9a-f]+$/
raise SOCKSError, 'TCP/IPv6 over SOCKS is not yet supported (inet_pton missing in Ruby & not supported by Tor)'

0 comments on commit f30d8e2

Please sign in to comment.