Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'socket': 0.05; '21,': 0.07; 'parser': 0.07; 'plenty': 0.07; 'python': 0.09; 'cc:addr :python-list': 0.10; 'suggest': 0.11; 'task.': 0.16; 'tcp': 0.16; 'twisted': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'feb': 0.19; 'email addr:gmail.com>': 0.20; 'all,': 0.21; 'cheers,': 0.23; 'cc:2**0': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'url:wiki': 0.26; 'am,': 0.27; 'message- id:@mail.gmail.com': 0.27; 'this?': 0.28; 'fast.': 0.29; 'leverage': 0.29; 'url:mailman': 0.29; 'framework': 0.30; 'code': 0.31; 'implement': 0.32; 'url:python': 0.32; 'sources': 0.32; 'url:listinfo': 0.32; 'received:google.com': 0.34; 'doing': 0.35; 'url:org': 0.36; 'useful': 0.36; 'thank': 0.36; 'resources': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'url:mail': 0.40; 'traffic': 0.61; 'between': 0.63; 'taking': 0.65; 'brown': 0.65; 'pleased': 0.66; '2013': 0.84; 'url:trac': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=a8ufcCiVh8wAtCrT0ySKoDpShy1phogbiK+swJuwmmQ=; b=W3JDVOfWzZSv9lBGQsVxRrBwgP4S2pvj+7d7/3YqGg1ZWXEiKDeZO7TK5ZcwRvPy0D 9KNg3hpDgv1q1tF3UxhLdbePdj4PyhhBmOWbdDFqnslDXiY6Mj5+3K4gAVTD7mn76EM/ 6ZX31qEYLql6aWPuh6vUKTcsiRLYW7daISttfUth+q5t5IO0/dEDiBfrYvvdD9QsMP9m n3hszeGojcx8yUXXfU5NrgaH2owCMcNgP5i+vJ9i+K6tNUADFTvLMCXrucn8vuy280ub sJ4fZV8E+3K/qKkz97BKM/rdcMDI4PG16pR0wLbwxkynnDiTmWYui5VvrstgWqpeg70/ zwcw== MIME-Version: 1.0 X-Received: by 10.42.122.66 with SMTP id m2mr11056569icr.15.1361461650773; Thu, 21 Feb 2013 07:47:30 -0800 (PST) In-Reply-To: References: Date: Thu, 21 Feb 2013 17:47:30 +0200 Subject: Re: Transparent Proxy and Redirecting Sockets From: Luca Bongiorni To: Rodrick Brown Content-Type: multipart/alternative; boundary=20cf3003bbb611d7bc04d63dfe81 Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 115 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361461659 news.xs4all.nl 6852 [2001:888:2000:d::a6]:37668 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39437 --20cf3003bbb611d7bc04d63dfe81 Content-Type: text/plain; charset=ISO-8859-1 2013/2/21 Rodrick Brown > On Thu, Feb 21, 2013 at 10:24 AM, Luca Bongiorni wrote: > >> Hi all, >> Around I have found plenty useful sources about TCP transparent proxies. >> However I am still missing how to make socket redirection. >> >> What I would like to do is: >> >> host_A <--> PROXY <--> host_B >> ^ >> | >> host_C <------ >> >> At the beginning the proxy is simply forwarding the data between A and B. >> Subsequently, when a parser catches the right pattern, the proxy quit the >> communication between A and B and redirect all the traffic to the host_C. >> >> I would be pleased if someone would suggest me some resources or hints. >> >> > Are you looking for a Python way of doing this? I would highly recommend > taking a look at ha-proxy as its very robust, simple and fast. If you're > looking to implement this in Python code you may want to use a framework > like Twisted - http://twistedmatrix.com/trac/wiki/TwistedProject > > Twisted provides many functionality that can leverage to accomplish this > task. > Thank you for the hint. I will start to delve on it right now. Cheers, Luca > > >> Thank you :) >> Cheers, >> Luca >> >> -- >> http://mail.python.org/mailman/listinfo/python-list >> > > --20cf3003bbb611d7bc04d63dfe81 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2013/2/21 Rodrick Brown <rodrick.brown@gmail.com>
<= div class=3D"gmail_quote">
On Thu, Feb 21, 2013 at 10:24 AM, Luca Bongiorni <bongio= 87@gmail.com> wrote:
Hi all,
Around I have found plenty useful sources about TCP transparent proxies. Ho= wever I am still missing how to make socket redirection.

What I would like to do is:

host_A <--> PROXY <--> host_B
=A0 =A0 =A0 =A0 =A0 =A0 =A0 ^
=A0 =A0 =A0 =A0 =A0 =A0 =A0 |
host_C <------

At the beginning the proxy is simply forwarding the data between A and B. Subsequently, when a parser catches the right pattern, the proxy quit the c= ommunication between A and B and redirect all the traffic to the host_C.
I would be pleased if someone would suggest me some resources or hints.


Are you looking for a Python way of do= ing this? I would highly recommend taking a look at ha-proxy as its very=A0= robust,=A0simple and fast. If you're looking to=A0implement=A0this in P= ython code you may want to use a framework like Twisted -=A0http://twi= stedmatrix.com/trac/wiki/TwistedProject=A0

Twisted provides many functionality that can leverage t= o accomplish this task.=A0

Tha= nk you for the hint. I will start to delve on it right now.
Cheers,
Luca
=A0
=A0
Thank you :)
Cheers,
Luca

--
http://mail.python.org/mailman/listinfo/python-list


--20cf3003bbb611d7bc04d63dfe81--