File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,12 @@ def transport_config_reverse_http(opts={})
59
59
:uri => uri ,
60
60
:comm_timeout => datastore [ 'SessionCommunicationTimeout' ] . to_i ,
61
61
:retry_total => datastore [ 'SessionRetryTotal' ] . to_i ,
62
- :retry_wait => datastore [ 'SessionRetryWait' ] . to_i
62
+ :retry_wait => datastore [ 'SessionRetryWait' ] . to_i ,
63
+ :proxy_host => datastore [ 'PayloadProxyHost' ] ,
64
+ :proxy_port => datastore [ 'PayloadProxyPort' ] ,
65
+ :proxy_type => datastore [ 'PayloadProxyType' ] ,
66
+ :proxy_user => datastore [ 'PayloadProxyUser' ] ,
67
+ :proxy_pass => datastore [ 'PayloadProxyPass' ]
63
68
}
64
69
end
65
70
Original file line number Diff line number Diff line change @@ -88,7 +88,13 @@ def transport_block(opts)
88
88
]
89
89
90
90
if url . start_with? ( 'http' )
91
- proxy_host = to_str ( opts [ :proxy_host ] || '' , PROXY_HOST_SIZE )
91
+ proxy_host = ''
92
+ if opts [ :proxy_host ] && opts [ :proxy_port ]
93
+ prefix = 'http://'
94
+ prefix = 'socks=' if opts [ :proxy_type ] . downcase == 'socks'
95
+ proxy_host = "#{ prefix } #{ opts [ :proxy_host ] } :#{ opts [ :proxy_port ] } "
96
+ end
97
+ proxy_host = to_str ( proxy_host || '' , PROXY_HOST_SIZE )
92
98
proxy_user = to_str ( opts [ :proxy_user ] || '' , PROXY_USER_SIZE )
93
99
proxy_pass = to_str ( opts [ :proxy_pass ] || '' , PROXY_PASS_SIZE )
94
100
ua = to_str ( opts [ :ua ] || '' , UA_SIZE )
@@ -120,7 +126,6 @@ def extension_block(ext_name, file_extension)
120
126
end
121
127
122
128
def config_block
123
-
124
129
# start with the session information
125
130
config = session_block ( @opts )
126
131
You can’t perform that action at this time.
0 commit comments