Hi Michael,
Thank you for reporting these two issues.
Regarding Issue 1 ...
I am sorry, but I am unable to reproduce the problem you are describing in Issue 1. In my case, when I enter an URL of a WebServer as a proxy, I receive 404 Not Found as a result, the Client does not freeze. And if I enter something stupid (no real URL), the client is unable to post the request and returns with Request Aborted. In my case, the behavior is the same wether I have proxy username/password entered or leave it empty.
I have tested this on Windows Vista Business 32bit with the latest updates installed. Can you please debug the code to see where the code hangs and tell me which Windows version is causing the freezing problem?
The fastest way to find the location where the app freezes is to set breakpoints in the "rtcWinHttpCliProv.pas" unit at the beginning of following methods:
- WriteHeader(SendNow:boolean=True);
- SendHeaderOut(const s:string);
- Write(const s:string; SendNow:boolean=True);
- AcceptResponse;
- SetupProxy;
If there is a problem with the RTC SDK, it has to be in one of the above methods.
Regarding Issue nr. 2 ...
The behavior you are experiencing is either a problem of the WinHTTP API you are using, or a problem of the Proxy server which wants the client to authenticate for every single request. The correct behavior with the default options should actually be to receive the contents of the page where you are being redirected and not to get the 407 response.
I know that WinHTTP and WinInet APIs have automatic redirection set by default and had planned to make this behavior optional by adding a new parameter to the RtcHttpClient component, but the question remains why the WinHTTP API is not going through with the request but instead ends the request after the 407 response. If the problem is not in the WinHTTP API, then the only other problem source could be the proxy - which is asking for the user to authenticate AGAIN after he has already done so in the prior request.
I will be adding an option to disable auto-redirects when using WinHTTP and WinInet APIs, which should give you the 301 response you are expecting, but I can not release any updates for at least two more weeks because we are currently in the middle of porting the RTC SDK to FPC/Lazarus for Linux and the code is currently not production-ready.
If you can not wait so long, the only alternative would be for you to make the change in your version. The function you need to call from the WinHTTP api is already available ("InternetSetOption" function maps to the "WinHttpSetOption" API). Should you decided to add this option to your version of the RTC SDK (before we have the update ready), pleae read this article in the MSDN KB:
http://msdn.microsoft.com/en-us/library/aa384067(VS.85).aspxAs for the 1st issue, I will need your help to debug the code and let me know what you find out, since I am unable to reproduce the problem on my PC.
Best Regards,
Danijel Tkalcec