Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Socket connection to the Tor server
Camille Cr
1/23/2009 11:41:00 PM
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.
--
Posted via
http://www.ruby-...
.
1 Answer
Camille Cr
1/24/2009 2:34:00 PM
0
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 Roux wrote:
> 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.
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Socket connection to the Tor server
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password