Socket connection to the Tor server

C

Camille Cr

Hi,

I'd like to code a script able to connect to the Tor server. Find above
the command line script. I'd like to do the same in ruby. I tried using
TCPSocket, Net::Telnet... no way.

Thank you
Camille


SHELL SESSION:
camille$ telnet 127.0.0.1 9051
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
authenticate
250 OK

...

quit
250 closing connection
Connection closed by foreign host.
 
C

Camille Roux

I found finally how to do that. I forgot to write \r\n at each end of
line.
Here the code:

require 'net/telnet'

t = TCPSocket.new("localhost",'9051')
t.puts("authenticate\r\n")
puts t.gets
#...
t.puts("quit\r\n")
puts t.gets


Camille said:
Hi,

I'd like to code a script able to connect to the Tor server. Find above
the command line script. I'd like to do the same in ruby. I tried using
TCPSocket, Net::Telnet... no way.

Thank you
Camille


SHELL SESSION:
camille$ telnet 127.0.0.1 9051
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
authenticate
250 OK

...

quit
250 closing connection
Connection closed by foreign host.
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top