[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-developers] [Fwd: [tor-dev] How to integrate an external name re

From: Jeff Burdges
Subject: [GNUnet-developers] [Fwd: [tor-dev] How to integrate an external name resolver into Tor]
Date: Tue, 02 Aug 2016 16:47:21 +0200

Appears worth forwarding here for future GNS stuff.

-------- Forwarded Message --------
From: Nick Mathewson <address@hidden>
Reply-to: address@hidden
To: address@hidden
Subject: [tor-dev] How to integrate an external name resolver into Tor
Date: Tue, 2 Aug 2016 09:37:53 -0400

Hi, all!

I've seen a couple of emails from people looking into new ways to do
naming for onion services.  That's great!  Before anybody gets too
far, I'd like to send this quick note to let you know that integrating
stuff like this into Tor is actually easier than you think.

Here's how you do it, using a Tor controller.  (See control-spec.txt
for protocol documentation. Also see one of the several friendly
libraries, like steam, that exist to interface with Tor over this

First, you set the Tor option "__LeaveStreamsUnattached".  This tells
Tor that it shouldn't try to handle new client requests immediately,
but it should instead let the controller take responsibility.

In the controller, you make sure that you are watching STREAM events
so that you find out about new streams.

Whenever there's a new stream, you check its address.  If the address
is one that you don't want to rewrite, you just call ATTACHSTREAM on
it, with a circuit ID of 0. (The 0 means "Tor, you figure out how to
attach this one.".

Otherwise, you do whatever magic dance you do in order to find out the
real address for the stream.

If the lookup operation is successful, you say "REDIRECTSTREAM (stream
ID) (new address".  And then you ATTACHSTREAM as above.

If the lookup operation fails, you call "CLOSESTREAM (stream ID) 2".
(The 2 means "resolve failed".

And that's it for the Tor integration!  All you need to do now is
figure out how the name lookup works.

tor-dev mailing list

Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]