Jump to content

xenog

Members
  • Content Count

    9
  • Joined

  • Last visited

Everything posted by xenog

  1. I have an unusual requirement and wonder if it's possible with ICS. I have an embedded device that can serve web pages using HTTP. The device is usually installed on a private network, so I cannot access it over the Internet. The device has the means to make a socket connection to any port, so it can escape the private network and firewalls. I use a TSslWSocket to listen for a connection from the device and then manually send an HTTP GET command to the device and wait for the reply. There's no SSL involved. This works well for simple GET commands, but I'd like to do more. Is it possible to pass the socket from TSslWSocket to a component like THttpCli? It would be nice to find a way to have a browser in my app talk to the device. Thanks in advance for your help. Richard
  2. I can try to make a class that inherits from THttpCli. This should allow me change the protected member FCtrlSocket and then call SocketSessionConnected. Should I FreeAndNil(FCtrlSocket) before I assign the new socket to the device? My Pascal is not good (C++ usually). Thanks for indulging me with this unusual request. It's a shame more devices don't do this and then you could play too 🙂 Cheers, Richard
  3. Hi Angus, Thanks for your reply. The device is not making an HTTP connection to my server. It is simply opening a socket and sending zero bytes. This can be on any port (not usually 80). I don't need to acknowledge with 200 OK or any other message. Once the device has made the connection to my server, I can then send a message back to the device. If I make an HTTP GET message and send it using TSslWSocket SendStr the device will reply with 200 OK and the page I asked for. I know it's a very strange way to do something, but it's also a clever way to access a device's web page when the device is behind NAT and firewalls. Thanks for your help. Richard
  4. I have a customer whose FTP Server is not correctly configured. They will not change it, which is very frustrating. When my FTPS Client issues the PASV command, the server responds with its local IP address and a port number. It should of course respond with the public IP, if the FTP Server was configured correctly. The TSslFtpClient tries to connect to the local IP that is sent by the server, but obviously fails, as the local IP is hidden behind a NAT router. I noticed that the FileZilla Client gets round this problem by trying the local IP and when it fails it then tries the public IP that it originally connected to. Command: PASV Response: 227 Entering Passive Mode (192,168,0,173,113,168). Status: Server sent passive reply with unroutable address. Using server address instead. My Delphi skills are awful (I code in C++ Builder), so I can't attempt to replicate what FileZilla does. I have made two small changes to my copy of OverbyteIcsFtpCli.pas. I apologise for the poor code, but can anyone tell me if this is OK to do to or if there is a better way. This code is added to DoGetAsync and DoPutAppendAsync if (FDnsResult <> TargetIP) and (FDnsResult.Length > 0) then DataSocketGetInit(IntToStr(TargetPort), FDnsResult) else DataSocketGetInit(IntToStr(TargetPort), TargetIP); The original code was just DataSocketGetInit(IntToStr(TargetPort), TargetIP); Thanks, Richard
  5. xenog

    FTPS Passive Mode

    Hi François, I have both the Delphi and C++ personalities installed and it is clear that Embarcadero have problems with C++ Builder. If I install the Delphi ICS, it builds and installs with no problems. If I then try and use these components in a C++ project, I get compile errors as C++ Builder can't find the lib and hpp files and then I get linker errors as it can't find the obj files. This is entirely an Embarcadero problem, as your code works perfectly. If I try to install ICS with the C++ Builder packages, I don't get the hpp files or obj files, even if I change the project properties to output all Builder files. Some of these problems could be down to my lack of understanding of how C++ Builders with packages. I'll try again next week and see if I can find a way to get Builder to be happy. Failing that, I may install the Delphi ICS, so that I have the components on the palette, and then add the ICS PAS files to each of my C++ builder projects, so that it can make the hpp and obj files. It's shame that Embarcadero can't allow a Delphi component to work seamlessly in a C++ project. I did try installing ICS from Getit, but that only works for Delphi projects. Thanks for the beautiful components. They are a joy to use. Richard
  6. xenog

    FTPS Passive Mode

    Thanks Angus. I tried to upgrade today, but getting C++ Builder to install the latest ICS is proving difficult. Builder seems to want the lib, obj and hpp files and is being really awkward. Not your fault at all, as the Delphi version installs super easily. I did notice that you added your ftpFixPasvLanIP fix to DoGetAsync, but you haven't added it to DoPutAppendAsync. Does this mean that the PASV problem will still exist when sending a file to a server? Thanks for all you do to keep this amazing software in such good shape. Richard
  7. I've recently noticed that in RAD Studio 10.3.2 I cannot access the ICS components from the palette when I am using a C++ form. In earlier versions of RAD Studio the Delphi-only components were available to be dropped onto C++ forms. I appreciate this isn't an ICS problem as it will probably apply to all DX-only components, but I'm hoping others here will have a better solution. than my workaround. The workaround I have is to create a Delphi form in a C++ project and then add the ICS component(s) to the Delphi form and then cut/paste the component onto the C++ form. This will only work for RAD Studio users, as C++ Builder-only users cannot create Delphi forms in their C++ project. Thanks in advance for any help/info you can provide. Richard
  8. Oh hell. Just me then 🙂 Thanks for checking. I installed from GetIt, so maybe I'll try installing the traditional way to see if they appear on the palette. Thanks again, Richard
  9. Thanks Angus. I really appreciate all you do for us. This isn't an ICS problem, so I'm just hoping that some other C++ users will have encountered the same problem and found a better solution than my workaround. Richard
×