Transparent Proxy and Redirecting Sockets

Discussion in 'Python' started by Luca Bongiorni, Feb 21, 2013.

  1. 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.

    Thank you :)
    Cheers,
    Luca
    Luca Bongiorni, Feb 21, 2013
    #1
    1. Advertising

  2. 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 :)
    > Cheers,
    > Luca
    >
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >
    Rodrick Brown, Feb 21, 2013
    #2
    1. Advertising

  3. 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
    >>

    >
    >
    Luca Bongiorni, Feb 21, 2013
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jack Vamvas

    java.net.sockets and MS Proxy

    Jack Vamvas, Jul 13, 2003, in forum: Java
    Replies:
    1
    Views:
    491
    Tim Jowers
    Jul 14, 2003
  2. Michael Spahn
    Replies:
    0
    Views:
    1,113
    Michael Spahn
    Dec 7, 2004
  3. paul koelle
    Replies:
    3
    Views:
    2,315
    aurora
    Jan 28, 2005
  4. Karsten Wutzke
    Replies:
    1
    Views:
    870
    Steven Simpson
    Aug 20, 2007
  5. Michael Vondung

    Code for a transparent proxy?

    Michael Vondung, May 9, 2004, in forum: Ruby
    Replies:
    1
    Views:
    133
    Kaspar Schiess
    May 9, 2004
Loading...

Share This Page