Does SOCKSSocket work?

A

Alan Johnson

[Note: parts of this message were removed to make it a legal post.]

I am having trouble with class SOCKSSocket. I am trying to get the
following minimal example to work:
require 'socket'
s = SOCKSSocket.new('www.google.com', 80)

Running this I get:
$ ruby example.rb
example.rb:2: uninitialized constant SOCKSSocket (NameError)

First, I assume that SOCKS support must be compiled into ruby, but I cannot
determine which set of compile flags enables it. Second, looking at the ruby
source code, it appears that the only SOCKSSocket methods that are even
defined are initialize and close, which makes me wonder how it could
possibly work.

If it matters I am using Fedora 9. Thanks.
 
A

Alan Johnson

[Note: parts of this message were removed to make it a legal post.]

Hi,

In message "Re: Does SOCKSSocket work?"
|I am having trouble with class SOCKSSocket. I am trying to get the
|following minimal example to work:
|require 'socket'
|s = SOCKSSocket.new('www.google.com', 80)
|
|Running this I get:
|$ ruby example.rb
|example.rb:2: uninitialized constant SOCKSSocket (NameError)
|
|First, I assume that SOCKS support must be compiled into ruby, but I
cannot
|determine which set of compile flags enables it. Second, looking at the
ruby
|source code, it appears that the only SOCKSSocket methods that are even
|defined are initialize and close, which makes me wonder how it could
|possibly work.

First, you have to specify --enable-socks=true to configure (or
extconf.rb run) with libsocks installed.

Second, that's OK, SOCKSSocket inherits everything else from
TCPSocket. I myself have not tested SOCKSSocket for a while,
but I assume it still works.

matz.
Thanks for the nudge in the right direction. Everything is working great
now. To
answer the question in the subject -- yes, SOCKSSocket works, except the
Net::FTP usage of it is broken in the trunk (patch submitted to ruby-core).
 

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
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top