@@ -381,14 +381,14 @@ def self.proxy(sock, type, host, port)
381381 first = false
382382
383383 routes . each do |host , port |
384- route_item = [ host , 0 , port , 0 , 0 ] . pack ( "A*CA*CC" )
385- if first
386- route_data = [ route_data , route_item . length , route_item ] . pack ( "A*NA*" )
387- first = true
388- else
389- route_data << route_item
390- end
391- end
384+ route_item = [ host , 0 , port , 0 , 0 ] . pack ( "A*CA*CC" )
385+ if first
386+ route_data = [ route_data , route_item . length , route_item ] . pack ( "A*NA*" )
387+ first = true
388+ else
389+ route_data << route_item
390+ end
391+ end
392392
393393 # TODO: This is really hard to follow
394394 ni_packet << [ route_data . length - 4 ] . pack ( 'N' )
@@ -402,9 +402,9 @@ def self.proxy(sock, type, host, port)
402402 end
403403
404404 begin
405- ret_len = sock . recv ( 4 ) . unpack ( 'H*' ) [ 0 ]
406- if ret_len !=0
407- ret = sock . recv ( ret_len . to_i )
405+ ret_len = sock . recv ( 4 ) . unpack ( 'H*' ) [ 0 ]
406+ if ret_len !=0
407+ ret = sock . recv ( ret_len . to_i )
408408 end
409409 rescue IOError
410410 raise Rex ::ConnectionProxyError . new ( host , port , type , "Failed to receive a response from the proxy" ) , caller
@@ -427,10 +427,10 @@ def self.proxy(sock, type, host, port)
427427 end
428428 elsif ret =~ /NI_PONG/
429429 # would like to print this "[*] remote native connection to #{host}:#{port} established\n"
430- else
431- raise Rex ::ConnectionProxyError . new ( host , port , type , "Connection to #{ host } :#{ port } failed - #{ ret } \n \n #{ ni_packet } " )
430+ else
431+ raise Rex ::ConnectionProxyError . new ( host , port , type , "Connection to #{ host } :#{ port } failed - #{ ret } \n \n #{ ni_packet } " )
432432 end
433-
433+
434434 when 'http'
435435 setup = "CONNECT #{ host } :#{ port } HTTP/1.0\r \n \r \n "
436436 size = sock . put ( setup )
0 commit comments