From: Robert Klemme Date: 2007-08-10T17:13:02+09:00 Subject: Re: Net::HTTP works on localhost, but error Errno::ECONNRESET 2007/8/10, Caleb Mei : > Hi All, > > Newbie here, on XP with Ruby 1.8.6.25, I am trying to post a request to > an external service basic HTTP/XML Form Post. I have tried multiple > test, but getting this error, > > Errno::ECONNRESET (An existing connection was forcibly closed by the > remote host.): > c:/ruby/lib/ruby/1.8/net/protocol.rb:133:in `sysread' > c:/ruby/lib/ruby/1.8/net/protocol.rb:133:in `rbuf_fill' > > The code, > url = URI.parse('http://www.yahoo.com') # not working > url = URI.parse('http://localhost:8080/default.txt') # working fine > > http = Net::HTTP.new(url.host) > puts "===== Begin ======" > puts url.path > puts url.host > puts url.port > > res = Net::HTTP.start(url.host, url.port) {|http| > http.get('/index.htm') > } > puts res.body > @result = res.body > puts "===== End ======" > > No proxy. Downloading 1.8.5 to give it a try. > > Anyone experience similar issue? Recommendation to use other library to > make HTTP/XML call? > > Really appreciated! The first thing I would make sure is that there are no network issues (corporate firewall killing off the connection). Kind regards robert