From: Tannev Vitaliy <444ert666@...> Date: 2008-06-11T22:21:51+09:00 Subject: Socks v5 protocol Hello, only I start to study this language. And at once a greater problem: (( I can not understand connection under the report socks5 in any way, and connection, inquiry of the version and methods of authorization passes successfully, and here when I try to transfer the removed host and port I socks-server does not see the address in inquiry, in broad gullies writes, approximately it: [11/Jun/2008:16:45:39 MSD] [19267] 192.168.0.9 "" "CONNECT" CONNREFUSED 0 0 - (192.168.0.9:51012 -> 210.199.9.0:0) [11/Jun/2008:16:45:39 MSD] [19270] [ERRO] $ConnectServing$: (Connection timed out). [11/Jun/2008:16:45:39 MSD] [19270] 192.168.0.9 "" "CONNECT" CONNREFUSED 0 0 - (192.168.0.9:51014 -> 210.199.9.0:0) [11/Jun/2008:16:45:39 MSD] [19272] [ERRO] $ConnectServing$: (Connection timed out). [11/Jun/2008:16:45:39 MSD] [19272] 192.168.0.9 "" "CONNECT" CONNREFUSED 0 0 - (192.168.0.9:51016 -> 210.199.9.0:0) And here a code of connection: ................ sock.setHost("194.67.23.111",25) .............. def hextobin(str) temp = str.gsub("\s", ""); ret = [] (0...temp.size()/2).each{|index| ret[index] = [temp[index*2, 2]].pack("H2")} return ret end def setHost(domain,port) host=domain h="05 01 00" if host =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ ip=[$1.to_i,$2.to_i,$3.to_i,$4.to_i].pack('CCC') h+=" 01 " +[host.size].pack('C')+ip else h+=" 03" + [host.size].pack('C') + host end h+=[port].pack('n') @sock.write(hextobin(h)) t=@sock.recv(1).unpack("H*").to_s return t[3..3] end ............. As we see, I ask ip: 194.67.23.111:25, and up to socks-server reaches: 210.199.9.0:0.... I Turn out somehow not so I pack data: (((.. Prompt please, that can be not so: ((( -- Posted via http://www.ruby-forum.com/.