Building a proxy server
"Ashish Parajuli" <[email protected]> Wed, 16 Jan 2008 15:08:28 +0545
| Newsgroups | gmane.comp.lib.libwww |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
------=_NextPart_000_0018_01C85851.AA0293B0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
I am trying to build a HTTP proxy. The listening and accepting module is
already ready. I want to use libwww to get the request (data) from the
client, make some modification to it and send it to the destination =
server.=20
=20
1. A live socket descriptor is given after a TCP connection from the
client is established.
2. I need to get HTTP data from this descriptor using libwww. (I want
all the chunk handling and parsing of headers to be done by libwww)
3. I need to parse this data, do some modification to it and send it to
the destination server.
4. I don't need to tamper any HTTP headers only the data portion needs
to be modified.
5. I also need to create my own request and send it to the destination
server with anything being sent by the client.
=20
How do I use a live socket and bind it with libwww and get data to and =
from
client and server.
=20
Any help will be highly appreciated.
=20
And does anybody use libwww nowadays I don't seem to find any posts in =
the
mailing list. Has libwww become obsolete.=20
=20
=20
PRIVACY NOTICE
This email and any attachments may be confidential and/or privileged. =
Use of the information contained in this email by anyone other than the =
intended recipient is strictly prohibited. If you have received this =
email in error, please notify the sender by replying to this message and =
delete this email.
------=_NextPart_000_0018_01C85851.AA0293B0
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<HTML >
<HEAD>
<META http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:1533886562;
mso-list-type:hybrid;
mso-list-template-ids:853993342 67698703 67698713 67698715 67698703 =
67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:.5in;
mso-level-number-position:left;
text-indent:-.25in;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
-->
</style>
</HEAD>
<BODY lang=3DEN-US link=3Dblue vlink=3Dpurple>
<DIV>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I am trying to build a HTTP proxy. The listening and
accepting module is already ready. I want to use libwww to get the =
request
(data) from the client, make some modification to it and send it to the =
destination
server. <o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<ol style=3D'margin-top:0in' start=3D1 type=3D1>
<li class=3DMsoNormal style=3D'mso-list:l0 level1 lfo1'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>A live socket =
descriptor is
given after a TCP connection from the client is =
established.<o:p></o:p></span></font></li>
<li class=3DMsoNormal style=3D'mso-list:l0 level1 lfo1'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>I need to get HTTP =
data from this
descriptor using libwww. (I want all the chunk handling and parsing =
of
headers to be done by libwww)<o:p></o:p></span></font></li>
<li class=3DMsoNormal style=3D'mso-list:l0 level1 lfo1'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>I need to parse this =
data, do
some modification to it and send it to the destination =
server.<o:p></o:p></span></font></li>
<li class=3DMsoNormal style=3D'mso-list:l0 level1 lfo1'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>I don’t need to =
tamper
any HTTP headers only the data portion needs to be =
modified.<o:p></o:p></span></font></li>
<li class=3DMsoNormal style=3D'mso-list:l0 level1 lfo1'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>I also need to create =
my own
request and send it to the destination server with anything being =
sent by
the client.<o:p></o:p></span></font></li>
</ol>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>How do I use a live socket and bind it with libwww =
and get
data to and from client and server.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Any help will be highly =
appreciated.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>And does anybody use libwww nowadays I don’t =
seem to
find any posts in the mailing list. Has libwww become =
obsolete.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
</div>
</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>
<P CLASS=3D"MsoNormal">
<FONT FACE=3D"Courier New" SIZE=3D"1"><SPAN STYLE=3D"FONT-SIZE: 9pt; =
FONT-FAMILY: 'Courier New'">PRIVACY NOTICE<BR><BR>This email and any =
attachments may be confidential and/or privileged. Use of the =
information contained in this email by anyone other than the intended =
recipient is strictly prohibited. If you have received this email in =
error, please notify the sender by replying to this message and delete =
this email.</SPAN></FONT>
</P>
</DIV></BODY></HTML>
------=_NextPart_000_0018_01C85851.AA0293B0--