Jump to content

omnibrain

Members
  • Content Count

    107
  • Joined

  • Last visited

Everything posted by omnibrain

  1. omnibrain

    Best internet components

    I use ICS for most stuff. The little complaints I have usually get addressed fast.
  2. As far as I understand it they are for the label itself. I‘m interested in further „processing“ the SVG or a PNG.
  3. I still enjoying trying out the components and have some first ideas but not enough time. But I have a few questions: The Demos seem to be a bit messed up pathwise. Difficult to describe, I think it's best if you do a clean install and open a Demo in Delphi yourself and then start it from within Delphi. You have SaveSVG and ExportDoc procedures. Both save to files. Is there a reason there is no option to save to a stream to continue processing the generated label directly in a program? Or am I overlooking something? I managed to hide almost all control elements of the editor component. But not the scrollbars. Am I overlooking something? I see that you can use a CSV file or JSON as Data Source. But is it also possible to use a TDataSet?
  4. I ordered it because I have lots of ideas how to use it (especially the technical drawings) to augment our software. 🙂 Let's see how this goes. If nothing else our customers will be able to create nice labels 😉
  5. I'm currently looking to integrate softphone functionality into our software. I'm looking for VoIP/SIP SDKs/components. 2 years ago I alreay tried (and even bought) Delphi SIP components but ran into trouble when the other side hanging up did not get registered correctly. I raised the issue with the developer but he soon stopped responding. It was easy to use, but at the same time rather limited. Now I found VoIP SIP SDK - ABTO Software's VoIP SIP SDK and VoIP SDK, SIP SDK for creating audio, video, and IM Apps (portsip.com) and VoIP für Unified Communications | GlobalIPTel and VaxVoIP SIP SDK - Develop SIP Softphone, webphone, video conferencing, audio conferencing, SIP Server, IPPBX, web dialer, SIP Tunneling Server, Call Recording Server, and IP-Telephony services. and SIP SDK for Windows (mizu-voip.com) Has any of you experience with either? Or can anyone recommenend another SDK/component? My first goal is to implement a softphone client with call recording and possibly audio playback. It should also be able to receive/decode DTMF tones. Possibly later I want to implement DIN CLC/TS 50134-9 "Social Alarm Systems"
  6. omnibrain

    Looking for VoIP/SIP client SDKs/components

    That one's initially very expensive... Do you know what renewals cost?
  7. As far as I know Mosquitto is the reference implementation for MQTT.
  8. I'm currently developing an API using THttpAppSrv and custom programmed handlers. It's intendet to be used as a machine to machine API, so I use basic auth. TLS get's handled by a reverse proxy. I initialise the Component als follows: HttpAppSrv1.AuthTypes:=[atBasic]; HttpAppSrv1.AddGetHandler('/objects',Tlisaapirada); HttpAppSrv1.AddPostHandler('/objects',Tlisaapirada); HttpAppSrv1.Start(); My "getPassowrdHandler looks like this. "user" and "pass" are populated during startup of my program. procedure Tfio_lisaapi.HttpAppSrv1AuthGetPassword(Sender, Client: TObject; var Password: string); var ClientCnx : TMyHttpConnection; begin ClientCnx:=Client as TMyHttpConnection; if (ClientCnx.AuthTypes=[atBasic]) and (ClientCnx.AuthUserName=user) then Password := pass; end; My AuthResult just does some logging procedure Tfio_lisaapi.HttpAppSrv1AuthResult(Sender, Client: TObject; Success: Boolean); begin if Success then Display('Auth: true') else Display('Auth: false'); end; When I call my "/objects" endpoint (get and post) with the correct user name and password everything works as expected. Wenn I use a wrong username or password the "get" gets denied with a "401 Access Denied", as expected. But for the "post" my "Tlisaapirada.Execute" procedure gets called and executed. This should not happen, instead it should lead to a 401 as well. Do I miss some configuration on the THttpAppSrv component, or do I need to write special processing?
  9. omnibrain

    Codolex 2.0 is now Free - Low-Code for Delphi

    I don't 100% understand what this is. Is this a tool that creates code that you can adjust and then compile, or is this something you integrate (like a workflow engine) into an existing application?
  10. omnibrain

    Delphi Low-code No-code?

    In the end each tool has their uses. 2 years ago I had to quickly add a customer portal to our software. A customer of one of our customers wanted to be able to access protocols and reports. Giving them direct access was no option. So I set up a DB server, built a custom periodic data export, and used a no/low code tool named Budibase to build a web frontend. Because I have total control over the data I export I could work around limitations regarding data representation by simply adjusting my export logic.
  11. omnibrain

    Experiences with D2Bridge Framework

    Interesting, never heard of it before. It looks like it is more in the direction of WEB framework & components for Delphi & Visual Studio Code | TMS Software than FMSoft uniGUI Web Application Framework There are of course also Elevate Software, Inc. Quartex Pascal – Research and development for the next generation object pascal (quartexdeveloper.com) and Smart Mobile Studio | About | Smart Mobile StudioAbout - Smart Mobile Studio but they are not 100% Delphi but rather Object Pascal and Delphi inspired. Perhaps a user of some of them can chime in.
  12. Just to add: the // quick and dirty should not handle the 404 case, otherwise nothing works anymore, because the flags comes with hg404 if you "try" static serving first.
  13. No problem. I just wanted to try it now and report my findings so you have all the information when you find time to look into it.
  14. I debugged the issue for a bit: In THttpConnection.ProcessPostPutPat Flags gets changed from hg401 to hgAcceptData, so the "case Flags of hg401" never gets triggered. Perhaps there needs to be a check for the 40x-Flags before the "if (FRequestMethod = httpMethodPost) then TriggerPostDocument(Flags) ..." block. Quick and dirty, seems to work, but I don't know if something further down the line breaks: {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} procedure THttpConnection.ProcessPostPutPat; { V8.08 } var Flags : THttpGetFlag; begin { POST and no content-length received, we treat this as "bad request" } { and don't pass it to the component user. } if (not FRequestHasContentLength) or (FRequestContentLength < 0) then begin { HTTP/1.0 A valid Content-Length is required on all HTTP/1.0 POST requests. An HTTP/1.0 server should respond with a 400 (bad request) message if it cannot determine the length of the request message's content. HTTP/1.1 The presence of a message-body in a request is signaled by the inclusion of a Content-Length or Transfer-Encoding header field in the request's message-headers. For compatibility with HTTP/1.0 applications, HTTP/1.1 requests containing a message-body MUST include a valid Content-Length header field unless the server is known to be HTTP/1.1 compliant. If a request contains a message-body and a Content-Length is not given, the server SHOULD respond with 400 (bad request) if it cannot determine the length of the message, or with 411 (length required) if it wishes to insist on receiving a valid Content-Length. Currently we act as a HTTP/1.0 server. } FKeepAlive := FALSE; Answer400; { We close the connection non-gracefully otherwise we might receive data we cannot handle properly. } CloseDelayed; Exit; end; {$IFNDEF NO_AUTHENTICATION_SUPPORT} if not FAuthenticated then Flags := hg401 else {$ENDIF} if FOutsideFlag and (not (hoAllowOutsideRoot in FOptions)) then Flags := hg403 else Flags := hg404; case Flags of // quick and dirty hg400: begin FKeepAlive := FALSE; Answer400; CloseDelayed; exit; end; {/V7.30 } hg401: begin if FKeepAlive = FALSE then {Bjornar} PrepareGraceFullShutDown; Answer401; exit; end; hg403: begin if FKeepAlive = FALSE then {Bjornar} PrepareGraceFullShutDown; Answer403; exit; end; hg404: begin if FKeepAlive = FALSE then {Bjornar} PrepareGraceFullShutDown; Answer404; exit; end; end; FAcceptPostedData := FALSE; if (FRequestMethod = httpMethodPost) then TriggerPostDocument(Flags) else if (FRequestMethod = httpMethodPut) then TriggerPutDocument(Flags) else if (FRequestMethod = httpMethodPatch) then TriggerPatchDocument(Flags); if (not FAcceptPostedData) and (FRequestContentLength > 0) then begin { V7.30 } { The component user doesn't handle posted data. } { Turn LineMode off if RequestContentLength > 0, we'll turn it } { back on again in our overridden method Receive. } LineMode := FALSE; FPostCounter := FRequestContentLength; end else FPostCounter := 0; case Flags of hg400: begin FKeepAlive := FALSE; Answer400; CloseDelayed; end; {/V7.30 } hg401: begin if FKeepAlive = FALSE then {Bjornar} PrepareGraceFullShutDown; Answer401; end; hg403: begin if FKeepAlive = FALSE then {Bjornar} PrepareGraceFullShutDown; Answer403; end; hg404: begin if FKeepAlive = FALSE then {Bjornar} PrepareGraceFullShutDown; Answer404; end; hgAcceptData: FAcceptPostedData := TRUE; else if FKeepAlive = FALSE then {Bjornar} CloseDelayed; end; end;
  15. I got a (somewhat working example with minimal changes to the demo. I used the postinfo-Demo, because I think you added that specifically to test POST. \demos-data\WebAppServerData\Templates\postinfo.htm is missing, but that doesn't matter for the test. My one change: procedure TWeblServerForm.SslHttpAppSrv1AuthGetType(Sender, Client: TObject); var ClientCnx : TMyHttpConnection; begin //{ It's easyer to do the cast one time. Could use with clause... } ClientCnx := TMyHttpConnection(Client); if CompareText(ClientCnx.Path, '/DemoBasicAuth.html') = 0 then begin ClientCnx.AuthTypes := [atBasic]; ClientCnx.AuthRealm := 'DemoBasicAuth'; end else if CompareText(ClientCnx.Path, '/postinfo.html') = 0 then begin // Added for Debugging Basic Auth ClientCnx.AuthTypes := [atBasic]; ClientCnx.AuthRealm := 'DemoBasicAuth'; end GET with no credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" 192.168.178.105 - WEB-APP /postinfo.htm Answer Log - 2024-03-27 23:35:45 WEB-APP SYCORAX 0.0.0.0 GET /postinfo.html - 86 - 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 401 337 218 0 GET with wrong credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" AuthGetPassword for "/postinfo.html" AuthType is "atBasic" [23:37:08 192.168.178.105] authentication result failed with type Basic for /postinfo.html 192.168.178.105 - WEB-APP /postinfo.html Answer Log - 2024-03-27 23:37:08 WEB-APP SYCORAX 0.0.0.0 GET /postinfo.html - 86 test1 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 401 337 257 0 GET with correct credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" AuthGetPassword for "/postinfo.html" AuthType is "atBasic" [23:38:01 192.168.178.105] authentication result OK with type Basic for /postinfo.html 192.168.178.105 - WEB-APP /postinfo.html POST/PUT Content Size 0 Request Content Type Answer Log - 2024-03-27 23:38:01 WEB-APP SYCORAX 0.0.0.0 GET /postinfo.html - 86 test 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 200 563 261 0 POST with no credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" POST/PUT Content Size 8 Request Content Type: text/plain Raw Params: Testdata Raw Params: Testdata= Post URL: http://192.168.247.109:86/postinfo.html From IP Address: 192.168.178.105 Answer Log - 2024-03-27 23:39:25 WEB-APP SYCORAX 0.0.0.0 POST /postinfo.html - 86 - 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 200 563 272 0 POST with wrong credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" AuthGetPassword for "/postinfo.html" AuthType is "atBasic" [23:40:33 192.168.178.105] authentication result failed with type Basic for /postinfo.html POST/PUT Content Size 8 Request Content Type: text/plain Raw Params: Testdata Raw Params: Testdata= Post URL: http://192.168.247.109:86/postinfo.html From IP Address: 192.168.178.105 Answer Log - 2024-03-27 23:40:33 WEB-APP SYCORAX 0.0.0.0 POST /postinfo.html - 86 test1 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 200 563 311 0 POST with correct credentials Request requires authentication "/postinfo.html" AuthType is "atBasic" AuthGetPassword for "/postinfo.html" AuthType is "atBasic" [23:41:23 192.168.178.105] authentication result OK with type Basic for /postinfo.html [23:41:23 192.168.178.105] 1: HTTP/1.1 POST /postinfo.html POST/PUT Content Size 8 Request Content Type: text/plain Raw Params: Testdata Raw Params: Testdata= Post URL: http://192.168.247.109:86/postinfo.html From IP Address: 192.168.178.105 Answer Log - 2024-03-27 23:41:23 WEB-APP SYCORAX 0.0.0.0 POST /postinfo.html - 86 test 192.168.178.105 HTTP/1.1 PostmanRuntime/7.37.0 192.168.247.109:86 200 563 315 0 As you can see, with GET only with correct credentials .execute gets called. With POST .execute always gets called.
  16. GET is working. POST is where I have trouble. I'm going to try to reproduce it with the sample.
  17. I don't think this works properly in 9.1. On GET with failed Authentication I get a 401 from ICS with the following document (btw, where can I edit/override this?): <HTML><HEAD><TITLE>401 Access Denied</TITLE></HEAD><BODY><H1>401 Access Denied</H1>The requested URL /ping requires authorization.<P></BODY></HTML> On POST I still land in my .Execute-Function. But Client.AuthUserName doesn't get cleared. I would expect, that like with GET I don"t even come into the .Execute-Function. The second best solution would be, if the FAuthenticated was available at the Client. So I could check this. (It took me two years to get back to this, because I was building other endpoints where I do custom jwt processing and had no need for basic auth, in case you wonder)
  18. omnibrain

    Delphi-neon, any thought?

    I use it as main serializer/deserializer for various json based protocols. No complaints so far and it makes programming easier. I did not benchmark it for speed, because we are only talking about a few messages per second. For serializing/deserialiszing table data I use viniciussanchez/dataset-serialize: JSON to DataSet and DataSet to JSON converter for Delphi and Lazarus (FPC) (github.com)
  19. omnibrain

    ICS V9.1 announced

    I never changed anything in there so I had no problem "overwriting" it. I prefer to understand the settings, and change them if needed, so this was alright to me. Starting with 9.0 I started using ICS "directly" instead of via GetIt and I also decided to vendor the used release into my git repo, so I can easily track the changes between the releases, or if I have to patch something.
  20. omnibrain

    ICS V9.1 announced

    Update went (at least I think so) without a hitch. Because the way we deploy our software is a bit special I had to change the SSL-Settings, but I think it is ok, that you chose the new way as default.
  21. I added a PUT handler to my API (so far I worked with POST, for my new API iteration I'm finally getting to implementing PUT), but it does not get dispatched. HttpAppSrv1.AddPutHandler('/'+porticoversion+'/object/*',Tlisaapiportico); // Person anlegen PUT /object/{oid}/person Tlisaapiportico is implementing TUrlHandler. I debugged, and it looks like the handler get's correctly added to the FPutHandler, but PutDispatchVirtualDocument gets never reached. Further debugging (and comparison with POST) lead me to TriggerPutDocument. When I comment out the "Flags-Check" it works. procedure THttpAppSrv.TriggerPutDocument( { V8.67 } Sender : TObject; var Flags : THttpGetFlag); begin //OutputDebugString(PChar('HTTP_PUT ' + (Sender as THttpAppSrvConnection).Path)); inherited TriggerPutDocument(Sender, Flags); { if Flags in [hgWillSendMySelf, hg404, hg403, hg401] then Exit ; } // Handle all virtual documents. Returns TRUE if document handled. if PutDispatchVirtualDocument(Sender as THttpAppSrvConnection, Flags) then Exit; // Reject anything else Flags := hg404; end; In TriggerDeleteDocument is a similar check. I did not test it yet, but I imagine I'm going to run into the same problem. Of course I don't know if the real problem is, that the flag get's set wrong somewhere higher in the call stack, or if the inherited call should do something instead.
  22. I downloaded and installed the latest daily snapshot from https://wiki.overbyte.eu/arch/icsv9w.zip but still can't get PUT to work. I still run into the "Flags"-check from my original post. Am I missing something else? The Flags in question contains hg404. The path I call the PUT with Postman is http://192.168.247.109:16008/v2/object/1004/person My other GET and POST Handlers work like they used to. Edit: If I comment out the Flags-Check like I did in my original post it now works. So your fix handling the uploads worked.
  23. When further testing I discovered an additional problem: My PUT obviously happens with data. But in my dispatched handler no data arrives. When debugging I noticed, that the handler get's dispatched before the data is received. An additional ConnectionDataAvailable where FState is hcPostedData happens after the dispatch. I meant to test it properly all earlier, after you implemented it for me, but other projects happened and my workaround with POST worked.
  24. I am using Delphi 11.2 (Patch 1) on Windows 11 (22H2): A few weeks ago, I added a check to our software to be able to verify against a time server independently of the rest of the system, as our customers had issues with internal network time synchronization in the past. Since Sunday, we "suddenly" have a one-hour deviation. Last weekend we went back from UTC+2 to UTC+1. I have simplified it to the most basic test possible, just a form with a TIdSNTP component and an edit box to enter the server. And even then, I still get a time that is exactly one hour in the future. Have I overlooked something? Since we are now on "standard time," I would have expected there to have been problems during development and testing in the past weeks. IdSNTP1.Host:=LabeledEdit1.Text; memo1.Lines.Add('Server: '+LabeledEdit1.Text+' Internet time: '+DateTimeToStr(IdSNTP1.DateTime)+' Local time: '+datetimetostr(now)); The result is:
  25. omnibrain

    TIdSNTP still providing daylight saving time

    Ah, I see. Thank you. I did not know, that Indy is on github. Let's hope the fixed version comes with Delphi 12.
×