socket not connected

M

Mateusz Winiarski

Hi,

I want to run simple code:

require 'net/http'
Net::HTTP.start('www.rubyinside.com') do |http|
req = Net::HTTP::Get.new('/test.txt')
puts http.request(req).body
end

but I've got following error:

A request to send or receive data was disallawed because the socket is
not connected and (when sending on a datagram socket using a sendto
call) no address was supplied. (Errno::ENOTCONN).

Is it because im behind proxy ?

How to make code run smoothly ?

Thx
 
Z

Zhukov Pavel

Hi,

I want to run simple code:

require 'net/http'
Net::HTTP.start('www.rubyinside.com') do |http|
req = Net::HTTP::Get.new('/test.txt')
puts http.request(req).body
end

but I've got following error:

A request to send or receive data was disallawed because the socket is
not connected and (when sending on a datagram socket using a sendto
call) no address was supplied. (Errno::ENOTCONN).

Is it because im behind proxy ?

Yes

How to make code run smoothly ?

Look at Net::HTTP::proxy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top