Delivery-Date: Thu, 01 Oct 2015 08:15:51 -0400
Return-Path: <tor-talk-bounces@lists.torproject.org>
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on moria.seul.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED,
	DKIM_SIGNED,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,HK_RANDOM_FROM,RCVD_IN_DNSWL_MED,
	T_DKIM_INVALID,T_RP_MATCHES_RCVD autolearn=ham version=3.3.1
X-Original-To: archiver@seul.org
Delivered-To: archiver@seul.org
Received: from eugeni.torproject.org (eugeni.torproject.org [38.229.72.13])
	(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by khazad-dum.seul.org (Postfix) with ESMTPS id B1CF51E08B9;
	Thu,  1 Oct 2015 08:15:49 -0400 (EDT)
Received: from eugeni.torproject.org (localhost [127.0.0.1])
	by eugeni.torproject.org (Postfix) with ESMTP id AB1A037BEF;
	Thu,  1 Oct 2015 12:15:43 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by eugeni.torproject.org (Postfix) with ESMTP id C717A37BE3
 for <tor-talk@lists.torproject.org>; Thu,  1 Oct 2015 12:15:40 +0000 (UTC)
X-Virus-Scanned: Debian amavisd-new at 
Received: from eugeni.torproject.org ([127.0.0.1])
 by localhost (eugeni.torproject.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 17ExL-HoTCgU for <tor-talk@lists.torproject.org>;
 Thu,  1 Oct 2015 12:15:40 +0000 (UTC)
Received: from mail-qg0-f47.google.com (mail-qg0-f47.google.com
 [209.85.192.47])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (not verified))
 by eugeni.torproject.org (Postfix) with ESMTPS id A81CB3545A
 for <tor-talk@lists.torproject.org>; Thu,  1 Oct 2015 12:15:37 +0000 (UTC)
Received: by qgt47 with SMTP id 47so62231208qgt.2
 for <tor-talk@lists.torproject.org>; Thu, 01 Oct 2015 05:15:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :content-type; bh=yhb9rm0fhUNvW0xBNJLZWAnDxWiOajeR6+pK0MnWsLo=;
 b=m8n2EJybJ1h5p/JHAnKQtNIXRJlVYPEKIGRKRNa8S9nwVKf9TWI0ZhFcz1QJwEC1cl
 lzHrCP8j5da1vDWPz13o56Pk3FX+p3bnMi25/xnBQLOpitGn3xHOTAtss5JcNqr12HWh
 G6fQSKMK91Xlh4uJBQ7tG46d3j8ZKs6WVcKlrSEaVPCTg0eIwurr5wLFU3uhBk7swdA5
 1Ta+mwDEg4xJ5/v6Xs49qIqU/EwHjWVIZY5qdrdwcr/vifgxd02vP1acXAcH6r/S8P09
 xBC5HLFj2SI6tiHzp6WZUGn+K+4HEWcHvJGwbUJu+oSrjN6KC2M9pc16if0QbPnOGgqC
 Kg5g==
MIME-Version: 1.0
X-Received: by 10.140.19.175 with SMTP id 44mr11372324qgh.50.1443701735055;
 Thu, 01 Oct 2015 05:15:35 -0700 (PDT)
Received: by 10.55.130.3 with HTTP; Thu, 1 Oct 2015 05:15:34 -0700 (PDT)
Received: by 10.55.130.3 with HTTP; Thu, 1 Oct 2015 05:15:34 -0700 (PDT)
In-Reply-To: <CAJJJ=-wz5uMVeB2UnWpoWT=ZmpnY7QoAkK=KDitiC9JO3o5wVg@mail.gmail.com>
References: <CAJwFvsWDxzLjhRLPa1xbW5EuXO1nw=BRR+uJTSqRxyu3BF9CYA@mail.gmail.com>
 <CAJwFvsXHjUWz8YwB70V3mfTrh9F=GwSCxpensEjEhLmBy-tjhQ@mail.gmail.com>
 <CAJJJ=-wz5uMVeB2UnWpoWT=ZmpnY7QoAkK=KDitiC9JO3o5wVg@mail.gmail.com>
Date: Thu, 1 Oct 2015 05:15:34 -0700
Message-ID: <CAAgxajFgN-A79=W0P__U2yOk3=tLjQe_mMDm-zHmLtFDOoXcUA@mail.gmail.com>
From: Apple Apple <djjdjdjdjdjdjd32@gmail.com>
To: tor-talk@lists.torproject.org
X-Content-Filtered-By: Mailman/MimeDel 2.1.15
Subject: Re: [tor-talk] How to write program that uses Tor network
X-BeenThere: tor-talk@lists.torproject.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: tor-talk@lists.torproject.org
List-Id: "all discussion about theory, design,
 and development of Onion Routing" <tor-talk.lists.torproject.org>
List-Unsubscribe: <https://lists.torproject.org/cgi-bin/mailman/options/tor-talk>, 
 <mailto:tor-talk-request@lists.torproject.org?subject=unsubscribe>
List-Archive: <http://lists.torproject.org/pipermail/tor-talk/>
List-Post: <mailto:tor-talk@lists.torproject.org>
List-Help: <mailto:tor-talk-request@lists.torproject.org?subject=help>
List-Subscribe: <https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-talk>, 
 <mailto:tor-talk-request@lists.torproject.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: tor-talk-bounces@lists.torproject.org
Sender: "tor-talk" <tor-talk-bounces@lists.torproject.org>

Asio is only a socket library which means you would need to build all the
Http logic on top of it, which is not very fun but everything you need to
know is documented in RFCs if you really want to go down that route.

The "best/ easiest" way would be to use a http library specifically for the
purpose of fetching webpages. Curl is a good one. To integrate Tor support
it is simply a matter of setting a SOCKs proxy, the same way you configure
a web browser to use Tor.

Make sure that your library contains an option to proxy DNS as well. If
fetching bing.com works but an onion site doesn't then you probably have a
DNS leak. Curl provides an option to fix this but it is not enabled by
default.

This is not really related to Tor but are you sure C++ is the right
language for this? You will quickly discover that web developers have a
very easy life. Not a single one of them is capable of writing valid HTML
but browsers need to process it anyway (hence why there are so many bugs in
browsers).

You can get kind of far using regular expressions. You can get kind of
further with libtidy and an XML parser. If you are serious though I would
recommend an alternative language such as ruby + nokogiri or python +
beautiful soup, at least to do the HTML parsing.

Of course you can always embed a parser written in another language into an
existing C++ code base (Python is easy, Ruby is harder but I have done it).
If you are still at the greenfields stage of the project you should think
about this early.

I hope this helps.
-- 
tor-talk mailing list - tor-talk@lists.torproject.org
To unsubscribe or change other settings go to
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-talk

