| Welcome, Guest |
You have to register before you can post on our site.
|
| Latest Threads |
The packages IW16.xx inc...
Forum: IntraWeb General Discussion
Last Post: hsbelli
Yesterday, 11:46 AM
» Replies: 2
» Views: 180
|
Redirection issues with F...
Forum: IntraWeb General Discussion
Last Post: magosk
08-31-2026, 10:03 AM
» Replies: 0
» Views: 68
|
Source Code
Forum: IntraWeb General Discussion
Last Post: magosk
08-31-2026, 08:11 AM
» Replies: 3
» Views: 378
|
TContenthandler requires ...
Forum: IntraWeb General Discussion
Last Post: valmeras
08-30-2026, 02:35 AM
» Replies: 0
» Views: 93
|
TIWjQDBGrid erratic behav...
Forum: IntraWeb General Discussion
Last Post: alex.trejo@tttnet.com.mx
08-20-2026, 05:12 PM
» Replies: 8
» Views: 1,893
|
Change Language DataTable
Forum: IntraWeb General Discussion
Last Post: Rigoberto Mercedes
08-19-2026, 03:21 PM
» Replies: 1
» Views: 236
|
How to terminate HTTP Thr...
Forum: Indy
Last Post: rlebeau
08-14-2026, 08:01 AM
» Replies: 5
» Views: 714
|
Looking for UI Design Tip...
Forum: Delphi General Discussion
Last Post: chrisjordon232
08-06-2026, 05:17 AM
» Replies: 0
» Views: 269
|
TIWjQDBGrid DateFormat
Forum: IntraWeb General Discussion
Last Post: brushbuny
08-05-2026, 03:31 AM
» Replies: 2
» Views: 1,668
|
Simply convert PeerIp to ...
Forum: Indy
Last Post: DidierMenant
08-04-2026, 03:50 PM
» Replies: 2
» Views: 398
|
|
|
| Indy TCPServer/TCPClient |
|
Posted by: wzehntner - 05-03-2018, 02:44 PM - Forum: Indy
- Replies (9)
|
 |
Hello,
We have developed a thread-based TCPServer-application running on company machine (Windows 7) with fixed IP and fixed Port.
We also developed a standalone TCPClient application distributed to our customers.
We are now planning to change this Client-Server model to use SSL encryption (a server certificate does exist).
Can you please point me to some sample code how to implement SSL on server and on client side.
Thanks in advance,
Wolfgang
|
|
|
| WebApplication.FormCount |
|
Posted by: cyracks - 05-01-2018, 12:19 PM - Forum: IntraWeb General Discussion
- Replies (1)
|
 |
Hello,
could you please help me on how to iterate over all forms included in the application.
Code: // for i:=0 to UserSession.WebApplication.FormCount-1 do
for i:=0 to WebApplication.FormCount-1 do
begin
OutputDebugString(PChar(WebApplication.Forms[i].Name));
end;
Code above lists only active or already opened forms. Forms that were not opened are not listed.
Regards,
Tomaž
|
|
|
| How to send POST data to a webserver? |
|
Posted by: BosseB - 04-30-2018, 09:56 PM - Forum: Indy
- Replies (19)
|
 |
This is a continuation of a thread at Embarcadero forum, which no longer responds to my input...
Background:
I have programmed an embedded IoT device (ESP8266) for which I have created a configuration application using FPC/Lazarus with Indylaz (Indy 10).
All of this works fine after some help from Remy L.
But there is one thing I also want to incorporate in the config application and this is firmware update via the network of the IoT device.
The ESP8266 has libraries with a lot of functions including web firmware updating, which I have included in my system.
It works as a simple web server operating on the http port of the IoT device, one simply opens the URI http://<ip address of IoT>/firmware and a minimal form is presented where there are two buttons, one file select button to select which firmware file to use and an Update button which starts the firmware update process.
The form presented by the IoT device on the URI shown above has the following html source:
Code: <html><head><title>The ESP8266 web updater</title></head>
<body><b>WiFi module firmware updater</b>
<br>Select firmware file, then click the Update button!<br>
<form method='POST' action='' enctype='multipart/form-data'>
<input type='file' name='update'>
<input type='submit' value='Update'>
</form>
</body></html>
The code I have used in Lazarus to try and send the data as a web browser would do looks like this after a brief discussion with Remy:
Code: function TConfigCommHandler.UploadFirmware(FileName: string; URL: string): boolean;
var
HTTP: TIdHTTP;
Src: TIdMultipartFormDataStream;
begin
Result := false;
if not FileExists(FileName) then exit;
HTTP := TIdHTTP.Create;
try
Src := TIdMultipartFormDataStream.Create;
try
Src.AddFile('update', FileName);
try
HTTP.Request.Username := FUserName;
HTTP.Request.Password := FPassword;
HTTP.Post(URL, Src);
Result := true;
except
on E: Exception do
FLastError := 'Exception: ' + E.Message;
end;
finally
Src.Free;;
end;
finally
HTTP.Free;
end;
end;
Behavior:
When I use the form in Firefox and select the file then hit Update, the result is directly shown on the IoT device's debug serial port by a message that it has started the update. Then when the file data has been fully received and verified the IoT device resets and the new firmware starts running. This works fine but involves a web browser...
When I use the method above then there is no error message or such generated, and there is also no debug message from the IoT device saying that update is in progress. In fact once the method is done nothing has happened on the IoT device. It looks like the IoT server is quietly disregarding the call.
So something is clearly missing here, but what?
How does one simulate the action of a form submission in a web browser but using Indy components in a FPC/Lazarus program?
|
|
|
| Need help implementing Base64Encode/DecodeBytes |
|
Posted by: RaelB - 04-30-2018, 05:07 PM - Forum: Indy
- Replies (2)
|
 |
Hello,
Can someone help me implement these functions (in Delphi XE4)
function Base64EncodeBytes(Input: TBytes): TBytes;
function Base64DecodeBytes(Input: TBytes): TBytes;
Could be using Indy or Soap.EncdDecd.
Thank you
Rael
|
|
|
| CSS & IE11 |
|
Posted by: JalcoJohn - 04-30-2018, 03:38 PM - Forum: IntraWeb General Discussion
- Replies (4)
|
 |
Hi Guys, I've developed an application that uses Style Sheets, each form has the same CSS file and each component has it's CSS property set to an entry in the CSS file.
All works brilliantly in Chrome, Firefox & Opera but Internet Explorer just won't play ball and doesn't seem to apply anything from the CSS file. My experience of CSS/HTML is limited and I guess IE doesn't like something in my CSS.
Any ideas or pointers would be much appreciated, I'm pulling my hair out.
Thanks
|
|
|
| (possible) bug with TIdMessageBuilderHtml |
|
Posted by: johnmay - 04-30-2018, 09:43 AM - Forum: Indy
- Replies (3)
|
 |
First of all, thanks for the new forum. It is unclear whether the community.embarcardero.com is a replacement for forums.embarcardero.com but all I see is that community is working and forums is not. Anyway, onto the possible bug.
In the example:
Quote:with TIdMessageBuilderHtml.Create do
try
PlainText.Text := 'plain text goes here';
FillMessage(IdMessage1);
finally
Free;
end;
It says that if PlainTextCharset and PlainTextContentTransfer are not specified it uses default values. The above generates:
Quote:Content-Type: text/plain; charset=us-ascii
plain text goes here
Good so far.
If I add some Unicode stuff:
Quote:with TIdMessageBuilderHtml.Create do
try
PlainText.Text := 'äüø';
FillMessage(IdMessage1);
finally
Free;
end;
Generates:
Quote:Content-Type: text/plain; charset=utf-8
äüø
It seems to use 8bit encoding - which is good... except... Content-Transfer-Encoding: 8bit (or maybe binary) is missing as it is using 8bit content in this case.
I can fix the problem by adding PlainTextContentTransfer := '8bit' or specifying PlainTextContentTransfer := 'quoted-printable' but the problem may be the default behavior of TIdMessageBuilderHtml which should specify this automatically, yet it doesn't. I noticed though that it does so for multipart messages but not for plain-text ones.
Based on the documentation (http://www.indyproject.org/Sockets/Blogs...16.EN.aspx), it should by default use quoted-printable if nothing is specified. And that does work for multipart messages.
I also tried to set the PlainTextCharset explicitly to utf-8 and not set PlainTextContentTransfer and same problem happens and causes an issue with some servers. It is probably the best to always specify the Content-Transfer-Encoding
RFC2046 -Note that if the specified character set includes 8-bit characters and such characters are used in the body, a Content-Transfer-Encoding header field and a corresponding encoding on the data are required in order to transmit the body via some mail transfer protocols, such as SMTP [RFC-821].
|
|
|
| TIdTCPClient on Linux in Delphi 10.2 |
|
Posted by: hsvandrew - 04-27-2018, 10:10 AM - Forum: Indy
- Replies (1)
|
 |
Hi guys, I'm having problems with RemObjects Remoting SDK TROSuperTCPChannel which uses TIdTCPClient to communicate.
When setting active = false -> disconnect or destroying the component which does the same thing, there is a 20-30 second delay before the destruction completes.
This doesn't occur with Delphi under Windows 32 or 64bit.
The issue is occurring on Centos 7 64bit in may case, I haven't tested other linux builds at this time.
I've tested identical code in Lazarus with Synapse and don't have any delays destroying their components that have connected to the same server.
I'm just wondering whether you can test TIdTCPClient running on Centos 7 64bit through a Delphi console app connecting to a Windows TIdTCPServer server on a delphi console app and see if you get the same issue or can see/suggest what might be causing it...
|
|
|
| IdTCPClient on Android: Connecting to non-active network |
|
Posted by: BartKindt - 04-26-2018, 05:16 AM - Forum: Indy
- Replies (17)
|
 |
I am not sure if the Indy system can help here, or that this is a pure Android issue (and forums.embarcadero.com is down again).
Android has an 'Active Network', which is set by the system. I get a notification from the 'ConnectionManager' when Android is changing this 'Active' network.
Problem is that Android claims the active network is "connected" when it has Internet access. NOT when it is in fact connected to a Network!
So I have this situation.
Android is connected to a WIFI network on which runs my Local Database Server. But this WIFI network does NOT have Internet access.
At the same time the Android device is also connected to a 'Mobile' network, which DOES have Internet access.
The ConnectionManager sends a notification that the Active Network is the Mobile network and that the WIFI network is NOT connected (but it is).
My App is aware that on the WIFI my Server is active (because I get a broadcast message from it via the IdUDPServer) on the WIFI network, which includes its IP address).
But when I try to connect to it, this connect request goes out over the Mobile network, NOT to the WIFI network.
So. Is there any way I can force the IdTCPClient to specifically do a 'Connect' to via the WIFI network (of which I can get all details) as opposed to the default 'Active' network?
PS:
I tried to set the BoundIP with the local IP address assigned to the WIFI network; But this does not have any effect:
{code}
IdSSLIOHandlerSocketOpenSSL1 := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Mode := sslmClient; // sslmUnassigned
IdSSLIOHandlerSocketOpenSSL1.SSLOptions.SSLVersions := [sslvTLSv1_2];
IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method := sslvTLSv1_2;
IdSSLIOHandlerSocketOpenSSL1.SSLOptions.VerifyDepth := 0;
IdSSLIOHandlerSocketOpenSSL1.OnStatusInfo := TDTBEventHandlers.IdSSLIOHandlerSocketOpenSSL1StatusInfo;
IdSSLIOHandlerSocketOpenSSL1.OnStatus := TDTBEventHandlers.IdSSLIOHandlerSocketOpenSSL1Status;
IdSSLIOHandlerSocketOpenSSL1.OnVerifyPeer := TDTBEventHandlers.IdSSLIOHandlerSocketOpenSSL1VerifyPeer;
IdSSLIOHandlerSocketOpenSSL1.PassThrough := true;
IdTCPClient1.IOHandler := IdSSLIOHandlerSocketOpenSSL1;
if NetworkData.LocalIP <> '' then
begin
IdTCPClient1.BoundIP := NetworkData.LocalIP;
IdSSLIOHandlerSocketOpenSSL1.BoundIP := NetworkData.LocalIP;
LocalLog('=== TCPThread.Execute: Connect using BoundIP: '+NetworkData.LocalIP);
end;
{code}
Thanks, Bart
|
|
|
|