BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to redirect all HTTP Requests in a client machine to pre

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
anil kumar
Guest





PostPosted: Mon Nov 24, 2003 6:14 am    Post subject: How to redirect all HTTP Requests in a client machine to pre Reply with quote



Hi all,
I am working on Filter product.
For that I need to have a small proxy component in every client
machine which should grab all HTTP Requests (from any browser/Delphi or VB
or Java Application ie independent of any browser/Application) and redirect
them to a predefined Proxy server. Can anyone suggest me how to go further.

Thanks in advance

Regards
Anil




Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon Nov 24, 2003 7:28 am    Post subject: Re: How to redirect all HTTP Requests in a client machine to Reply with quote




"anil kumar" <bkumar1 (AT) vanenburg (DOT) com> wrote


Quote:
For that I need to have a small proxy component in every client
machine which should grab all HTTP Requests (from any browser/Delphi
or VB or Java Application ie independent of any browser/Application)
and redirect them to a predefined Proxy server. Can anyone suggest me
how to go further.

What you ask for would require a low-level approach. You would have to hook
WinSock directly, or even lower at the NDIS or hardware driver level, and
then filter at those levels, just like firewalls do. NDIS would probably be
the easiest way to go. But no matter what, you won't be able to use Delphi
for it. Maybe for the GUI front-end, at least, but not for the guts of the
filtering. Borland tools do not support writing device drivers, so you have
to use Microsoft's DDK instead.


Gambit



Back to top
anil kumar
Guest





PostPosted: Mon Nov 24, 2003 10:46 am    Post subject: Re: How to redirect all HTTP Requests in a client machine to Reply with quote



Hi Gambit,
Thank you very much for the prompt reply.
My requirement in clent machine is to redirect all HTTP Requests to
a proxy server (Another group is working on Apache webserver to make this
proxy server). If its only for IE we can do configure IE to connect to the
required proxy server using Connection tab in Internet Options dialog. I
need to redirect all HTTP requests (no matter from where they are coming
from) to that proxy , i mean to say that there will not be any kind of
Filtering in client machine, the Filtering takes place at the proxy server
only. How you suggest me to go forward ,please respond.

Thanks in advance

Regards
Anil


"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote

Quote:

"anil kumar" <bkumar1 (AT) vanenburg (DOT) com> wrote in message
news:3fc1a19d (AT) newsgroups (DOT) borland.com...

For that I need to have a small proxy component in every client
machine which should grab all HTTP Requests (from any browser/Delphi
or VB or Java Application ie independent of any browser/Application)
and redirect them to a predefined Proxy server. Can anyone suggest me
how to go further.

What you ask for would require a low-level approach. You would have to
hook
WinSock directly, or even lower at the NDIS or hardware driver level, and
then filter at those levels, just like firewalls do. NDIS would probably
be
the easiest way to go. But no matter what, you won't be able to use
Delphi
for it. Maybe for the GUI front-end, at least, but not for the guts of
the
filtering. Borland tools do not support writing device drivers, so you
have
to use Microsoft's DDK instead.


Gambit





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon Nov 24, 2003 6:54 pm    Post subject: Re: How to redirect all HTTP Requests in a client machine to Reply with quote


"anil kumar" <bkumar1 (AT) vanenburg (DOT) com> wrote


Quote:
I need to redirect all HTTP requests (no matter from where
they are coming from) to that proxy

Again, what you ask for has to be handled at a lower level, especially since
you said earlier that it has to be application-independant. The only way to
intercept outgoing connections is as I said earlier - hook WinSock directly,
or write an NDIS driver.

Quote:
i mean to say that there will not be any kind of Filtering in client
machine


Yes, there will be, because you will have to manually decide which
connections are going to be using HTTP or not, based on the addresses they
are connecting to, which even that will be tricky to accomplish if they are
just connecting to IP addresses. HTTP is just a higher-level protocol that
sits on top of TCP, but to intercept and redirect TCP connections, you have
to intercept them at a much lower level that has no concept of HTTP at all,
which means that you will probably have to actually analyze the requests,
and maybe even the actual socket data, buffer it, and redirect it after you
know what it really is. TCP is just a byte stream, it has no concept of
higher-level protocols or what their content will be. So you will have to
handle that manually.

I am sorry, but what you are asking for is vastly more complex than what you
originally expected. I do not know what else to tell you right now.


Gambit



Back to top
Andy
Guest





PostPosted: Tue Nov 25, 2003 6:46 am    Post subject: Re: How to redirect all HTTP Requests in a client machine to Reply with quote

HTTP goes through one port, can you not re-direct just that one port to the
proxy (Port 8080 is it??) Indy might have something to help you, such as
TIdMappedPortTCP . If your Apache web server has a site that you want all to
see (Apache is a web
server, right?) then re-direct that one url in the hosts file, have a look
at hosts.sam, save it as hosts (Windoze). Do all requests the go out on the
internet via your proxy or does your 'proxy server' generate the html?. I am
reading between the lines a bit in you original message so excuse me if I
have it all wrong.

From Indy help:
Description

TIdMappedPortTCP is a TIdTCPServer descendant that implements a proxy for
connections to a remote computer system. TIdMappedPortTCP listens for
connections on a designated port number and makes a connection to another
server using a specified port number. This is useful for certain types of
proxy programs.



"anil kumar" <bkumar1 (AT) vanenburg (DOT) com> wrote

Quote:
Hi all,
I am working on Filter product.
For that I need to have a small proxy component in every client
machine which should grab all HTTP Requests (from any browser/Delphi or VB
or Java Application ie independent of any browser/Application) and
redirect
them to a predefined Proxy server. Can anyone suggest me how to go
further.

Thanks in advance

Regards
Anil











Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue Nov 25, 2003 8:06 am    Post subject: Re: How to redirect all HTTP Requests in a client machine to Reply with quote


"Andy" <net1 (AT) freewire (DOT) co.uk> wrote

Quote:
HTTP goes through one port

Port 80 is the default, but it is not required. HTTP servers are free to
listen on just about any port they want. 80 is just the most common.

Quote:
can you not re-direct just that one port to the proxy (Port 8080 is it??)

Whether it is just one port or many, you would still need to hook the system
at a lower level to do what anil was originally asking for.

Quote:
Indy might have something to help you, such as TIdMappedPortTCP .

That will not work for what anil was asking for.

Quote:
If your Apache web server has a site that you want all to see
(Apache is a web server, right?) then re-direct that one url in the
hosts file, have a look at hosts.sam, save it as hosts (Windoze).

That requires altering the host file for every client machine that anil
wants to redirect. Besides, that approach won't work anyway. The hosts
file is used during resolving hostnames. If you were to alter the file to
redirect all hostnames to a local server, that server is still responsible
for resolving the original hostname to the true address in order to
establish a connection to it. But such resolving would then try to use the
hosts file again, which you altered, so they won't resolve correctly. Even
if it did work, for what anil was asking, you would have to list every
possible hostname imaginable into that file, which wouldn't work either.


Gambit



Back to top
Andy
Guest





PostPosted: Tue Nov 25, 2003 5:43 pm    Post subject: Re: How to redirect all HTTP Requests in a client machine to Reply with quote

Anil Kumar, is that not Anal Cummer.... or is Anil just unlucky with his
name?, Like Mia Butreaks and Annete Kertain.

I just thought he was trying to use the Apache server as a web server and
had terminology wrong, just covering that angle. What he's trying to do
sounds interesting, almost viral.


Back to top
Andy
Guest





PostPosted: Tue Nov 25, 2003 7:14 pm    Post subject: Re: How to redirect all HTTP Requests in a client machine to Reply with quote

Sounds Viral, try http://www.astalavista.box.sk you'll find something there
I'm sure.


"anil kumar" <bkumar1 (AT) vanenburg (DOT) com> wrote

Quote:
Hi all,
I am working on Filter product.
For that I need to have a small proxy component in every client
machine which should grab all HTTP Requests (from any browser/Delphi or VB
or Java Application ie independent of any browser/Application) and
redirect
them to a predefined Proxy server. Can anyone suggest me how to go
further.

Thanks in advance

Regards
Anil







Back to top
Andy
Guest





PostPosted: Tue Nov 25, 2003 11:10 pm    Post subject: Re: How to redirect all HTTP Requests in a client machine to Reply with quote

Quote:
Port 80 is the default, but it is not required. HTTP servers are free to
listen on just about any port they want. 80 is just the most common.

Isn't that the whole point of Delphi / Indy.. who cares what port its on,
its done for you ? the beauty of the whole thing is these low level things
are dealt with without your even knowing it. My UDP 'thingy' sends on port
8093, only its realy sending on 10xx, the first free port, yet I recive on
8093, all dealt with for me.

I'll ty it out later... recon I'll make it work.



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue Nov 25, 2003 11:41 pm    Post subject: Re: How to redirect all HTTP Requests in a client machine to Reply with quote

"Andy" <net1 (AT) freewire (DOT) co.uk> wrote


Quote:
Isn't that the whole point of Delphi / Indy.. who cares what
port its on, its done for you ?

No, of course not. You still have to specify the ports yourself, they don't
magically figure them out for you. You have to tell a server what port to
listen for connections on. You have to tell a client what port the server
is listening on in order to connect to it. The only difference is that
standardized protocols, such as HTTP, may have *default* ports that are
used, but they still have to be specified programmably. In the case of an
HTTP client, for example, if you make a request for a resource and do not
specify an actual port, it *assumes* that port 80 is used, and will try to
use that port. That does not mean that port 80 is *actually* used by the
server, but it is likely.

That still does not negate anything I have said earlier in this disccusion,
though. You are thinking too high-level for what Anil was originally asking
for. He wants to intercept and reroute all HTTP connections across the
machine regardless of which applications are trying to make the connections.
Short of reconfiguring each and every single application to connect to his
proxy instead, which he specified stated he did *not* want to do, then the
*only* other option is hooking at the low-level stack levels.


Gambit



Back to top
xxx
Guest





PostPosted: Thu Nov 27, 2003 3:00 pm    Post subject: Re: How to redirect all HTTP Requests in a client machine to Reply with quote

hooking winsock api's globally can be done with the madlib, check out
http://www.madshi.net (the bcb/delphi section), this lib will lower
your high point of view ;)

good luck!

p.s : be aware of the fact that this lib does its job (perfectly) with
'hacks'. Writing a VXD driver should asure you that it works on EVERY
win platform. But at this time of writting, madlib supports all
windows versions tho, so you shouldnt worry at this time...
Back to top
anil kumar
Guest





PostPosted: Fri Nov 28, 2003 10:40 am    Post subject: Re: How to redirect all HTTP Requests in a client machine to Reply with quote

Hi Gambit,
Thats what i want exactly. Is there any way to intercept all the
HTTP requests only to reroute them to a predefined server (that also we will
develope on Apache where we filter the unwanted or objectionable content).
Right now i am working on a POC specific to IE by configuring IE to connect
a small proxy written in Delphi which inturn forward the request to Apache
server. But this can be changed by the user from Internet
options/connections/LAN settings which makes our filtering inactive.This is
OK in POC stage. But when going for actual product i need to make that small
proxy in the client machine a browser independent one and secured means not
breakable(Like in IE options in the above POC case). How can i do that?
please suggest me..
Note : There is a client level filter product called Pure Sight
, he is handling at WinSock level so tehir filter is browser independent.
How did they do? Please tell me suggestions.

Thanks in advance

Regards
Anil


"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote

Quote:

"Andy" <net1 (AT) freewire (DOT) co.uk> wrote in message
news:3fc3e0e5 (AT) newsgroups (DOT) borland.com...

Isn't that the whole point of Delphi / Indy.. who cares what
port its on, its done for you ?

No, of course not. You still have to specify the ports yourself, they
don't
magically figure them out for you. You have to tell a server what port to
listen for connections on. You have to tell a client what port the server
is listening on in order to connect to it. The only difference is that
standardized protocols, such as HTTP, may have *default* ports that are
used, but they still have to be specified programmably. In the case of an
HTTP client, for example, if you make a request for a resource and do not
specify an actual port, it *assumes* that port 80 is used, and will try to
use that port. That does not mean that port 80 is *actually* used by the
server, but it is likely.

That still does not negate anything I have said earlier in this
disccusion,
though. You are thinking too high-level for what Anil was originally
asking
for. He wants to intercept and reroute all HTTP connections across the
machine regardless of which applications are trying to make the
connections.
Short of reconfiguring each and every single application to connect to his
proxy instead, which he specified stated he did *not* want to do, then the
*only* other option is hooking at the low-level stack levels.


Gambit





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sat Nov 29, 2003 1:01 am    Post subject: Re: How to redirect all HTTP Requests in a client machine to Reply with quote


"anil kumar" <bkumar1 (AT) vanenburg (DOT) com> wrote


Quote:
Is there any way to intercept all the HTTP requests only
to reroute them to a predefined server

I already addressed that earlier.


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.