Re: [twsocket] Throttling solution - Integrate Dan's throttler into ICS?

2006-12-09 Thread Francois PIETTE
Have you looked at HTTP client component ? I implemented throttling not so 
long ago.

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be


- Original Message - 
From: "Jack" <[EMAIL PROTECTED]>
To: "ICS support mailing" 
Sent: Saturday, December 09, 2006 7:39 PM
Subject: [twsocket] Throttling solution - Integrate Dan's throttler into 
ICS?


>
> Although throttling has been brought up many times, I'm still
> in search for a simple throttling mechanism for my single-threaded
> server app.
>
> I just did a search in my emails, and found the following mentioning
> of throttling:
>
> Dan <[EMAIL PROTECTED]> has a wrapper for TWSocket class:
> http://www.xantorrent.pwp.blueyonder.co.uk/ics/uThrottledWSocket.pas
>
> There is a link here but the link to the code is broken, so I don't
> know how it works:
> http://www.smatters.com/ics/
>
> Dan's class would work if I'm using a TWSocket class directly.
> However, I'm actually using a TWSocketServer class, which in turn
> instantiates TWSocketClient class, which inherits from TWSocket. So, in
> order to use Dan's throttler, I'll have to change ICS code quite
> a bit, which I don't intent to do (for ease of ICS upgrade.)
>
> I'm using a single threaded server, so multi-threaded throttling
> mechanism won't be applicable.
>
> It sounds like a good idea to integrate Dan's throttler into ICS,
> if Dan and Francois agree. What do others say? Or, is there any
> easier ways to throttle the TWSocketClient class?
>
> -- 
> Best regards,
> Jack
>
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] Throttling solution - Integrate Dan's throttler into ICS?

2006-12-09 Thread Jack

Although throttling has been brought up many times, I'm still
in search for a simple throttling mechanism for my single-threaded
server app.

I just did a search in my emails, and found the following mentioning
of throttling:

Dan <[EMAIL PROTECTED]> has a wrapper for TWSocket class:
http://www.xantorrent.pwp.blueyonder.co.uk/ics/uThrottledWSocket.pas

There is a link here but the link to the code is broken, so I don't
know how it works:
http://www.smatters.com/ics/

Dan's class would work if I'm using a TWSocket class directly.
However, I'm actually using a TWSocketServer class, which in turn
instantiates TWSocketClient class, which inherits from TWSocket. So, in
order to use Dan's throttler, I'll have to change ICS code quite
a bit, which I don't intent to do (for ease of ICS upgrade.)

I'm using a single threaded server, so multi-threaded throttling
mechanism won't be applicable.

It sounds like a good idea to integrate Dan's throttler into ICS,
if Dan and Francois agree. What do others say? Or, is there any
easier ways to throttle the TWSocketClient class?

-- 
Best regards,
Jack

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] TWSocket support for HTTP proxy

2006-12-09 Thread Jack
Hello Arno,

Got it. Now I declare that my earlier comment on SSL and
using a proxy is officially INVALID :)

Although I am a contributor to the SSL project but I have
to admit that I have never looked at the SSL code ;-p

-- 
Best regards,
Jack

Saturday, December 9, 2006, 10:25:52 AM, you wrote:

> Hello Jack,

>> Hello Arno,
>> 
>> If you have tested it, I could be wrong. I didn't actually test it.
>> I just looked at the code below and it seems that SSL and Socks are
>> mutually exclusive. I didn't dig it further.
>> 
>> {$IFDEF USE_SSL}  { Makes the IDE happy }
>>   TBaseParentWSocket = TCustomSslWSocket;
>> {$ELSE}
>>   TBaseParentWSocket = TCustomSocksWSocket;
>> {$ENDIF}

> That's totally OK, TCustomSslWSocket is derived from TCustomSocksWSocket.
> Don't you have the SSL code?

> ---
> Arno Garrels [TeamICS]
> http://www.overbyte.be/eng/overbyte/teamics.html


 
>> --
>> Best regards,
>> Jack
>> 
>> Saturday, December 9, 2006, 9:59:17 AM, you wrote:
>> 
>>> Hello Jack,
>> 
>>> [..]
 - socks and SSL support in existing ICS code is not done in the
 ideal way.   As it is now, a socket is either an SSL socket or a
 socks socket. An SSL   connection should also also be able to go
 through a proxy server,   but not with the current code.
>> 
>>> Hmm, this worked fine in the past, but I have not tested Socks with
>>> SSL since a long time, so changes in the SSL code since that time
>>> may have broken it, if you say that Socks with SSL doesn't work in
>>> current versions I will reactivate my Socks5 box tomorrow to run a
>>> test again. 
>> 
>>> ---
>>> Arno Garrels [TeamICS]
>>> http://www.overbyte.be/eng/overbyte/teamics.html
>> 
>> 
>> 
 The SSL support should
 ideally be on top   of proxy (socks or http proxy) support.
 
 - http proxy support is added in parallel to socks, and http
 processing   is done after socks processing in the code. Only one
 type of proxy   (socks or http) can be used in one socket. This
 design of course will   not support proxy chaining. Ideally, proxy
 support should be flexible   enough to chain any number of socks and
 http proxies that support   CONNECT method.
 
 - the modification supports Basic authentication scheme only,
   and does not support Digest authentication scheme (quite some work
 :)
 
 - Once HTTP header is received, I'm reading one byte a time to read
   the rest of the reply, which is not the most efficient way. Since
   it's mostly reading from a buffer in memory, it should not be a
 big   deal. This has no impact if HTTP proxy is not in use.
 
 
 --
 Best regards,
 Jack
 
 Saturday, December 9, 2006, 1:13:30 AM, you wrote:
 
> Updated today.
 
> --
> Contribute to the SSL Effort. Visit
> http://www.overbyte.be/eng/ssl.html
> --
> [EMAIL PROTECTED]
> http://www.overbyte.be
 
 
> - Original Message -
> From: "Francois PIETTE" <[EMAIL PROTECTED]>
> To: 
> Sent: Friday, December 08, 2006 8:27 PM
> Subject: [twsocket] TWSocket support for HTTP proxy
 
 
>> Jack has patched the latest beta (Downloaded about a week ago) to
>> have TWSocket support http proxy tunneling. I've uploaded the file
>> at http://www.overbyte.be/arch/dump/WSocketHttpProxy.zip for
>> everyone review.

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] TWSocket support for HTTP proxy

2006-12-09 Thread Arno Garrels
Hello Jack,

> Hello Arno,
> 
> If you have tested it, I could be wrong. I didn't actually test it.
> I just looked at the code below and it seems that SSL and Socks are
> mutually exclusive. I didn't dig it further.
> 
> {$IFDEF USE_SSL}  { Makes the IDE happy }
>   TBaseParentWSocket = TCustomSslWSocket;
> {$ELSE}
>   TBaseParentWSocket = TCustomSocksWSocket;
> {$ENDIF}

That's totally OK, TCustomSslWSocket is derived from TCustomSocksWSocket.
Don't you have the SSL code?

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


 
> --
> Best regards,
> Jack
> 
> Saturday, December 9, 2006, 9:59:17 AM, you wrote:
> 
>> Hello Jack,
> 
>> [..]
>>> - socks and SSL support in existing ICS code is not done in the
>>> ideal way.   As it is now, a socket is either an SSL socket or a
>>> socks socket. An SSL   connection should also also be able to go
>>> through a proxy server,   but not with the current code.
> 
>> Hmm, this worked fine in the past, but I have not tested Socks with
>> SSL since a long time, so changes in the SSL code since that time
>> may have broken it, if you say that Socks with SSL doesn't work in
>> current versions I will reactivate my Socks5 box tomorrow to run a
>> test again. 
> 
>> ---
>> Arno Garrels [TeamICS]
>> http://www.overbyte.be/eng/overbyte/teamics.html
> 
> 
> 
>>> The SSL support should
>>> ideally be on top   of proxy (socks or http proxy) support.
>>> 
>>> - http proxy support is added in parallel to socks, and http
>>> processing   is done after socks processing in the code. Only one
>>> type of proxy   (socks or http) can be used in one socket. This
>>> design of course will   not support proxy chaining. Ideally, proxy
>>> support should be flexible   enough to chain any number of socks and
>>> http proxies that support   CONNECT method.
>>> 
>>> - the modification supports Basic authentication scheme only,
>>>   and does not support Digest authentication scheme (quite some work
>>> :)
>>> 
>>> - Once HTTP header is received, I'm reading one byte a time to read
>>>   the rest of the reply, which is not the most efficient way. Since
>>>   it's mostly reading from a buffer in memory, it should not be a
>>> big   deal. This has no impact if HTTP proxy is not in use.
>>> 
>>> 
>>> --
>>> Best regards,
>>> Jack
>>> 
>>> Saturday, December 9, 2006, 1:13:30 AM, you wrote:
>>> 
 Updated today.
>>> 
 --
 Contribute to the SSL Effort. Visit
 http://www.overbyte.be/eng/ssl.html
 --
 [EMAIL PROTECTED]
 http://www.overbyte.be
>>> 
>>> 
 - Original Message -
 From: "Francois PIETTE" <[EMAIL PROTECTED]>
 To: 
 Sent: Friday, December 08, 2006 8:27 PM
 Subject: [twsocket] TWSocket support for HTTP proxy
>>> 
>>> 
> Jack has patched the latest beta (Downloaded about a week ago) to
> have TWSocket support http proxy tunneling. I've uploaded the file
> at http://www.overbyte.be/arch/dump/WSocketHttpProxy.zip for
> everyone review.
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] TWSocket support for HTTP proxy

2006-12-09 Thread Fastream Technologies
What does TCustomSslWSocket derive from?

On 12/9/06, Jack <[EMAIL PROTECTED]> wrote:
> Hello Arno,
>
> If you have tested it, I could be wrong. I didn't actually test it.
> I just looked at the code below and it seems that SSL and Socks are
> mutually exclusive. I didn't dig it further.
>
> {$IFDEF USE_SSL}  { Makes the IDE happy }
>  TBaseParentWSocket = TCustomSslWSocket;
> {$ELSE}
>  TBaseParentWSocket = TCustomSocksWSocket;
> {$ENDIF}
>
> --
> Best regards,
> Jack
>
> Saturday, December 9, 2006, 9:59:17 AM, you wrote:
>
> > Hello Jack,
>
> > [..]
> >> - socks and SSL support in existing ICS code is not done in the ideal
> >> way.   As it is now, a socket is either an SSL socket or a socks
> >> socket. An SSL   connection should also also be able to go through a
> >> proxy server,   but not with the current code.
>
> > Hmm, this worked fine in the past, but I have not tested Socks with SSL 
> > since
> > a long time, so changes in the SSL code since that time may have broken it,
> > if you say that Socks with SSL doesn't work in current versions I will
> > reactivate my Socks5 box tomorrow to run a test again.
>
> > ---
> > Arno Garrels [TeamICS]
> > http://www.overbyte.be/eng/overbyte/teamics.html
>
>
>
> >> The SSL support should
> >> ideally be on top   of proxy (socks or http proxy) support.
> >>
> >> - http proxy support is added in parallel to socks, and http
> >> processing   is done after socks processing in the code. Only one
> >> type of proxy   (socks or http) can be used in one socket. This
> >> design of course will   not support proxy chaining. Ideally, proxy
> >> support should be flexible   enough to chain any number of socks and
> >> http proxies that support   CONNECT method.
> >>
> >> - the modification supports Basic authentication scheme only,
> >>   and does not support Digest authentication scheme (quite some work
> >> :)
> >>
> >> - Once HTTP header is received, I'm reading one byte a time to read
> >>   the rest of the reply, which is not the most efficient way. Since
> >>   it's mostly reading from a buffer in memory, it should not be a big
> >>   deal. This has no impact if HTTP proxy is not in use.
> >>
> >>
> >> --
> >> Best regards,
> >> Jack
> >>
> >> Saturday, December 9, 2006, 1:13:30 AM, you wrote:
> >>
> >>> Updated today.
> >>
> >>> --
> >>> Contribute to the SSL Effort. Visit
> >>> http://www.overbyte.be/eng/ssl.html
> >>> --
> >>> [EMAIL PROTECTED]
> >>> http://www.overbyte.be
> >>
> >>
> >>> - Original Message -
> >>> From: "Francois PIETTE" <[EMAIL PROTECTED]>
> >>> To: 
> >>> Sent: Friday, December 08, 2006 8:27 PM
> >>> Subject: [twsocket] TWSocket support for HTTP proxy
> >>
> >>
>  Jack has patched the latest beta (Downloaded about a week ago) to
>  have TWSocket support http proxy tunneling. I've uploaded the file
>  at http://www.overbyte.be/arch/dump/WSocketHttpProxy.zip for
>  everyone review.
>
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] TWSocket support for HTTP proxy

2006-12-09 Thread Jack
Hello Arno,

If you have tested it, I could be wrong. I didn't actually test it.
I just looked at the code below and it seems that SSL and Socks are
mutually exclusive. I didn't dig it further.

{$IFDEF USE_SSL}  { Makes the IDE happy }
  TBaseParentWSocket = TCustomSslWSocket;
{$ELSE}
  TBaseParentWSocket = TCustomSocksWSocket;
{$ENDIF}

-- 
Best regards,
Jack

Saturday, December 9, 2006, 9:59:17 AM, you wrote:

> Hello Jack,

> [..]
>> - socks and SSL support in existing ICS code is not done in the ideal
>> way.   As it is now, a socket is either an SSL socket or a socks
>> socket. An SSL   connection should also also be able to go through a
>> proxy server,   but not with the current code.

> Hmm, this worked fine in the past, but I have not tested Socks with SSL since
> a long time, so changes in the SSL code since that time may have broken it,
> if you say that Socks with SSL doesn't work in current versions I will
> reactivate my Socks5 box tomorrow to run a test again. 

> ---
> Arno Garrels [TeamICS]
> http://www.overbyte.be/eng/overbyte/teamics.html



>> The SSL support should
>> ideally be on top   of proxy (socks or http proxy) support.
>> 
>> - http proxy support is added in parallel to socks, and http
>> processing   is done after socks processing in the code. Only one
>> type of proxy   (socks or http) can be used in one socket. This
>> design of course will   not support proxy chaining. Ideally, proxy
>> support should be flexible   enough to chain any number of socks and
>> http proxies that support   CONNECT method.
>> 
>> - the modification supports Basic authentication scheme only,
>>   and does not support Digest authentication scheme (quite some work
>> :) 
>> 
>> - Once HTTP header is received, I'm reading one byte a time to read
>>   the rest of the reply, which is not the most efficient way. Since
>>   it's mostly reading from a buffer in memory, it should not be a big
>>   deal. This has no impact if HTTP proxy is not in use.
>> 
>> 
>> --
>> Best regards,
>> Jack
>> 
>> Saturday, December 9, 2006, 1:13:30 AM, you wrote:
>> 
>>> Updated today.
>> 
>>> --
>>> Contribute to the SSL Effort. Visit
>>> http://www.overbyte.be/eng/ssl.html
>>> --
>>> [EMAIL PROTECTED]
>>> http://www.overbyte.be
>> 
>> 
>>> - Original Message -
>>> From: "Francois PIETTE" <[EMAIL PROTECTED]>
>>> To: 
>>> Sent: Friday, December 08, 2006 8:27 PM
>>> Subject: [twsocket] TWSocket support for HTTP proxy
>> 
>> 
 Jack has patched the latest beta (Downloaded about a week ago) to
 have TWSocket support http proxy tunneling. I've uploaded the file
 at http://www.overbyte.be/arch/dump/WSocketHttpProxy.zip for
 everyone review. 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] TWSocket support for HTTP proxy

2006-12-09 Thread Arno Garrels
Hello Jack,

[..]
> - socks and SSL support in existing ICS code is not done in the ideal
> way.   As it is now, a socket is either an SSL socket or a socks
> socket. An SSL   connection should also also be able to go through a
> proxy server,   but not with the current code.

Hmm, this worked fine in the past, but I have not tested Socks with SSL since
a long time, so changes in the SSL code since that time may have broken it,
if you say that Socks with SSL doesn't work in current versions I will
reactivate my Socks5 box tomorrow to run a test again. 

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html



> The SSL support should
> ideally be on top   of proxy (socks or http proxy) support.
> 
> - http proxy support is added in parallel to socks, and http
> processing   is done after socks processing in the code. Only one
> type of proxy   (socks or http) can be used in one socket. This
> design of course will   not support proxy chaining. Ideally, proxy
> support should be flexible   enough to chain any number of socks and
> http proxies that support   CONNECT method.
> 
> - the modification supports Basic authentication scheme only,
>   and does not support Digest authentication scheme (quite some work
> :) 
> 
> - Once HTTP header is received, I'm reading one byte a time to read
>   the rest of the reply, which is not the most efficient way. Since
>   it's mostly reading from a buffer in memory, it should not be a big
>   deal. This has no impact if HTTP proxy is not in use.
> 
> 
> --
> Best regards,
> Jack
> 
> Saturday, December 9, 2006, 1:13:30 AM, you wrote:
> 
>> Updated today.
> 
>> --
>> Contribute to the SSL Effort. Visit
>> http://www.overbyte.be/eng/ssl.html
>> --
>> [EMAIL PROTECTED]
>> http://www.overbyte.be
> 
> 
>> - Original Message -
>> From: "Francois PIETTE" <[EMAIL PROTECTED]>
>> To: 
>> Sent: Friday, December 08, 2006 8:27 PM
>> Subject: [twsocket] TWSocket support for HTTP proxy
> 
> 
>>> Jack has patched the latest beta (Downloaded about a week ago) to
>>> have TWSocket support http proxy tunneling. I've uploaded the file
>>> at http://www.overbyte.be/arch/dump/WSocketHttpProxy.zip for
>>> everyone review. 
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] TWSocket support for HTTP proxy

2006-12-09 Thread Jack
Thanks Francois for uploading and updating the file.

Francois also asks me to explain a little what's done in the modification.

It's actually similar to the socks support. Instead of using a socks4
or socks5 proxy, the changes allow a socket to tunnel through HTTP proxy that
supports the CONNECT method. Basic authentication scheme is supported.
I tried to mimic the existing socks support code and add http proxy
support in parallel. Please note that some HTTP proxy server
configurations do not support CONNECT method on none-443 ports.

The changes are for ICS version 5 beta. Many people (Team ICS and the
list members) know ICS and Delphi much better than I do. It would be
great for you to review the changes to make sure I'm doing it right :)

Below are some issues that I can think of. Some are in my modification
some in the existing code for socks proxy support, which will take
more time to improve, and I am not the right person to fix it really.

- socks and SSL support in existing ICS code is not done in the ideal way.
  As it is now, a socket is either an SSL socket or a socks socket. An SSL
  connection should also also be able to go through a proxy server,
  but not with the current code. The SSL support should ideally be on top
  of proxy (socks or http proxy) support.
  
- http proxy support is added in parallel to socks, and http processing
  is done after socks processing in the code. Only one type of proxy
  (socks or http) can be used in one socket. This design of course will
  not support proxy chaining. Ideally, proxy support should be flexible
  enough to chain any number of socks and http proxies that support
  CONNECT method.

- the modification supports Basic authentication scheme only,
  and does not support Digest authentication scheme (quite some work :)

- Once HTTP header is received, I'm reading one byte a time to read
  the rest of the reply, which is not the most efficient way. Since
  it's mostly reading from a buffer in memory, it should not be a big
  deal. This has no impact if HTTP proxy is not in use.


-- 
Best regards,
Jack

Saturday, December 9, 2006, 1:13:30 AM, you wrote:

> Updated today.

> --
> Contribute to the SSL Effort. Visit
> http://www.overbyte.be/eng/ssl.html
> --
> [EMAIL PROTECTED]
> http://www.overbyte.be


> - Original Message - 
> From: "Francois PIETTE" <[EMAIL PROTECTED]>
> To: 
> Sent: Friday, December 08, 2006 8:27 PM
> Subject: [twsocket] TWSocket support for HTTP proxy


>> Jack has patched the latest beta (Downloaded about a week ago) to have
>> TWSocket support http proxy tunneling. I've uploaded the file at
>> http://www.overbyte.be/arch/dump/WSocketHttpProxy.zip for everyone review.


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] TWSocket support for HTTP proxy

2006-12-09 Thread Francois PIETTE
Updated today.

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be


- Original Message - 
From: "Francois PIETTE" <[EMAIL PROTECTED]>
To: 
Sent: Friday, December 08, 2006 8:27 PM
Subject: [twsocket] TWSocket support for HTTP proxy


> Jack has patched the latest beta (Downloaded about a week ago) to have
> TWSocket support http proxy tunneling. I've uploaded the file at
> http://www.overbyte.be/arch/dump/WSocketHttpProxy.zip for everyone review.
>
> --
> Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
> --
> [EMAIL PROTECTED]
> http://www.overbyte.be
>
>
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be