test/configs/simple.rb in fizx-proxymachine-1.3.0 vs test/configs/simple.rb in fizx-proxymachine-1.4.0

- old
+ new

@@ -19,9 +19,23 @@ { :remote => "localhost:9980" } elsif data == 'g' { :remote => "localhost:9980", :data => 'g2', :reply => 'g3-' } elsif data == 'h' { :remote => "localhost:9980", :callback => callback } + elsif data == 'connect reject' + { :remote => "localhost:9989" } + elsif data == 'inactivity' + { :remote => "localhost:9980", :data => 'sleep 3', :inactivity_timeout => 1 } else { :close => true } end -end \ No newline at end of file +end + +ERROR_FILE = File.expand_path('../../proxy_error', __FILE__) + +proxy_connect_error do |remote| + File.open(ERROR_FILE, 'wb') { |fd| fd.write("connect error: #{remote}") } +end + +proxy_inactivity_error do |remote| + File.open(ERROR_FILE, 'wb') { |fd| fd.write("activity error: #{remote}") } +end