indy

Indy HTTP Server URL-encoded request

若如初见. 提交于 2019-12-11 20:14:18
问题 When Indy HTTP server got request with url like a /find?location=%D1%82%D0%B5%D1%81%D1%82 (utf-8 url-encoded value), the "location" field in requestinfo's Params has unreadable value ÑеÑÑ. How to get readable value? Indy HTTPServer ver 10.6.0.4975 回答1: TIdHTTPServer currently parses input parameters using the charset specified in the Content-Type request header, and if there is no charset specified than Indy's 8bit encoding is used instead. This is a known limitation of TIdHTTPServer as

Idhttp post session expire

谁都会走 提交于 2019-12-11 19:35:59
问题 I'm using Idhttp (indy10 with delphi-xe2) to post form, but I get session expired message from the site, although I've already set cookie manager. Thank you. procedure TForm2.IdCookieManager1NewCookie(ASender: TObject; ACookie: TIdCookie; var VAccept: Boolean); begin ShowMessage(Acookie.CookieText); end; The result from ShowMessage is: ASP.NET_SessionId=enn1xnqde1o1rduedels5fqp; Path=/; Domain=www8.ticketingcentral.com; HttpOnly; Max-Age=252028195945; Expires=Fri, 31-Dec-9999 16:59:59 GMT 回答1

Indy SSL to plain socket pump

核能气质少年 提交于 2019-12-11 19:19:32
问题 I have to provide an SSL front for a plain TCP server, so I'm making a "pump" application that will provide an SSL connection to the outside while the original server can stay plain. I'm trying to use the Indy components to support my SSL needs, but I can't seem to get any data from the SSL port. I assigned the TIdTCPServer.OnExecute to the following event handler: procedure TForm1.IdTCPServer1Execute(AContext: TIdContext); var c:TIdTCPClient; cs,ss:TIdIOHandler; b:TBytes; begin c:

Prevent TIdTcpServer Stuck Connections

て烟熏妆下的殇ゞ 提交于 2019-12-11 16:45:32
问题 how are you? I come here ask for a solution, how prevent TIdTcpServer stuck connections? Version of indy 10.6.2.5341 and Rad Studio 10.1 Berlin On both images show the number of connections on TIdTcpServer, these numbers are retrieved from this function: var NumClients: Integer; begin with Form1.IdTCPServer1.Contexts.LockList do try NumClients := Count; finally Form1.IdTCPServer1.Contexts.UnlockList; end; Result := NumClients; What happen is, in almost cases this numbers only increase and not

Developing Client server application using INDY

[亡魂溺海] 提交于 2019-12-11 15:36:31
问题 I am currently developing a client server app , but i want to clarify some information about the following. What must be my idtcpserver binding IP adress (127.0.0.1 ,192.168.1.1 or my public IP) I checked it using IPconfig it replied me 192.168.1.1 ;but i have connected to the internet using my home adsl router(single port). I have assigned my client application with idtcpclient.host := my public IP address the application is working well when i assign both with 127.0.0.1 // as both are in

Can't open Https TSL page with Delphi - Indy Error : SSL23_GET_SERVER_HELLO

一曲冷凌霜 提交于 2019-12-11 14:59:59
问题 I want to read an HTML page via HTTPS using Indy's TIdHTTP in Delphi XE5. ssleay32.dll and libeay32.dll are in the main program folder. I am getting an error: SSL23_GET_SERVER_HELLO . What can I do to fix this? function get_page_text:string; var Response: String; HTTPClient: TidHTTP; const url = 'https://www.lustundreiz.com/login'; begin HTTPClient := TidHTTP.Create; HTTPClient.AllowCookies := True; HTTPClient.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); Response := HTTPClient.get

Replace cid:image refrences in email body with Base64 encoded string from another file

那年仲夏 提交于 2019-12-11 14:57:35
问题 I have been tasked with writing an email archiving application. With lots of help from other SO questions and answers, I have succesfully saved the body of the email using Indy10 in Delphi 10.2.3, and it's image attachments as Base64encoded text files. The body of an email with inline images contains strings like this: <img width=360 height=153 id="Picture_x0020_8" src="cid:image002.png@01D4F3AE.C0AE8970"> And of course, the base64 encoding for that image looks like this: data:image/x-png

IdNotify : How to pass parameteres to function

扶醉桌前 提交于 2019-12-11 13:53:35
问题 I have code typhoon with lazarus installed after a long strugle I have managed to include the unit IdSync to my project. How can I pass parameteres to a function that I want to execute in the main thread from TIdNotify ? 回答1: You have to override the TIdNotify.DoNotify() method, then you can pass whatever parameters you want, eg: type TMyNotify = class(TIdNotify) protected procedure DoNotify; override; end; procedure TMyNotify.DoNotify; begin SomeFunction(parameters); end; . begin ...

Indy http server session doesn't work well

﹥>﹥吖頭↗ 提交于 2019-12-11 13:29:35
问题 How can create session used with in idhttpserver ? I tryed alot of ways to do but I can't able to reach session object in ARequestInfo.Session or AResponseInfo.Session these are both of them always nil. please help procedure TFolsecPermissionManager.IdHTTPServerCommandGet(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo); var Command: TCommand; Session: TIdHTTPSession; begin Session := IdHTTPServer.CreateSession(AContext, AResponseInfo, ARequestInfo);

Encoding in Indy 10 and Delphi

江枫思渺然 提交于 2019-12-11 13:19:31
问题 I am using Indy 10 with Delphi. Following is my code which uses EncodeString method of Indy to encode a string. var EncodedString : String; StringToBeEncoded : String; EncoderMIME: TIdEncoderMIME; .... .... EncodedString := EncoderMIME.EncodeString(StringToBeEncoded); I am not getting the correct value in encoded sting. 回答1: What is the purpose of IndyTextEncoding_OSDefault ? Here's the source code for IndyTextEncoding_OSDefault . function IndyTextEncoding_OSDefault: IIdTextEncoding; begin if