From: John W Higgins Date: 2010-03-31T14:42:55+09:00 Subject: Re: Bind NICs to Mechanize --000e0cd5cd90b0150104831237d1 Content-Type: text/plain; charset=ISO-8859-1 Good Evening, On Tue, Mar 30, 2010 at 9:58 PM, John Yuan wrote: > > My goal is to launch 3 threads of Mechanize agents to access the same > URI (inventory.b2b.com/login) through 3 different NIFs (ppp1/eth2/ppp3) > . > Your best bet might be to set up 3 proxies and have each of the Mechanize clients hit a different proxy (using set_proxy for each instance) which would push each request to the proxy's assigned server. Something nice and simple like this should work ( http://github.com/igrigorik/em-proxy/blob/master/examples/line_interceptor.rb) - you would need 3 changes to this file 1) Obviously line 3 needs to have a different port for each of the proxies 2) Line 4 would need to point to a different ip corresponding to each of the three instances of inventory.b2b.com and the port would be 80 obviously 3) You don't want any substitution here so line 12 would simply be resp In theory that should push the requests to the appropriate server for you without a huge amount of work. I think you'll find em-proxy extremely flexible in terms of getting this task done for you. As with anything that messes with network traffic - there is some overhead - but you seem much more concerned with concurrency than milliseconds of delay. John --000e0cd5cd90b0150104831237d1--