Jump to content

Search the Community

Showing results for 'websocket' in content posted in ICS - Internet Component Suite.


Didn't find what you were looking for? Try searching for:


More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 44 results

  1. Angus Robertson

    ICS V9.1 announced

    There is a clever improvement in the GetIt ICS installation process, thanks Embarcadero. After the packages have been built and installed, the ICS demos-delphi-vcl project group opens in the IDE, allowing all the samples to be viewed and built, recommend saving the group as a favourite so it can be easily found. The group opens with the OverbyteIcsSnippets project, that provides one button examples of HTTP and FTP multiple file downloading and uploading, HTTP REST requests, Websocket client, TCP socket traffic, and sending email using Mail Queue. Angus
  2. I offer clients a REST API service to look-up telecommunication information, using the ICS web application server and MS SQL server. It works well, for low volumes of queries, but most users start a new SSL/TLS session for each query, which becomes a limiting factor with performance. So I want to offer a Websocket API as well, so one SSL/TLS session stays open, with just simple request/response packets sent. But how to adapt the REST HTTP request/response to Websocket? My queries are simple URL parameters, ie codelookapi.htm?numhistory=118118. Should the Websocket message just be the arguments or include the full or partial URL as well? Or something else, like a command? Should the initial Websocket request allow arguments, or just open the connection? Should be Websocket response message be just a JSON block, or include a wrapper of some sort, like the HTTP response header? Has anyone done a similar design? I just want to make it easy for clients using standard Websocket client libraries to integrate the new API. Angus
  3. Hi, Here may be a bug,would you please have a look?, unit: OverbyteIcsWebSocketCli.pas position: line 1494 ServerKey := Base64Encode(String(SHA1ofStr(s))); ------------ test: x3JJHMbDL1EzLkh9GBhXDw==258EAFA5-E914-47DA-95CA-C5AB0DC85B11 expect: HSmrc0sMlYUkAGmm5OPpG2HaGWk= output:HSmrc0sMlYUkAGmm5OPpG2E/aQ== ------------ test code: procedure TForm1.Button3Click(Sender: TObject); var s : AnsiString; ServerKey:string; begin s := AnsiString(edit1.Text); ServerKey := Base64Encode(String(SHA1ofStr(s))); memolog.Lines.Add(ServerKey); end; node.js - Base64 encoding for Sec-WebSocket-Accept value - Stack Overflow
  4. This Websocket client problem should be fixed in SVN and the overnight zip, assuming it was an ANSI/Unicode casting problem with non-English character set conversions, which I'm unable to reproduce. It did not affect Websocket server which had no casting, and yet always worked against our client. The real problem is ICS has overloaded versions of many functions for ANSI and Unicode, and the compiler does not always choose the correct version if input and output parameters don't match, fixed by using a specific ANSI function. I'm slowly adding TBytes versions for binary data to avoid such problems. but it's a long job. Angus
  5. Angus Robertson

    Designing a Websocket API

    The new Websocket API is live, when using streamlined requests, it handles about 100 SQL queries a minute from a single thread, although slower if the requests are sent sequentially waiting for a reply. Supporting JSON-RPC 2.0 on the server should not be hard, but does need POST support, I'll look at adding it to the ICS web server database sample. Client is a little harder since JSON-RPC 2.0 JSON-RPC uses a sequential ID to keep track of requests. Angus
  6. I will need to reproduce connection failures before I look into fixing them. So I need a Websocket server to test against. My only suggestion is to try the client against other servers and see if any fail, because no-one else has reported any problems. Angus
  7. Yes I am pretty sure it's a bug, I have debug into ICS and found the two function that caused failure of websocket connection , and am expecting fixing from more official way . I just a little time ago found it and am looking into those code , and not sure exact the correcting till now , so any suggestions are welcome
  8. Angus Robertson

    Designing a Websocket API

    No idea why this client is not using keep-alive, perhaps their REST library does not support it? The basic Websocket API is working, and the client can access another Websocket interface on the server so seem to know their stuff, now just need to design the pipelining, so that queued queries get returned to the correct client. I'll look at JSON-RPC 2.0 for next time. Angus
  9. Thijs van Dien

    Designing a Websocket API

    If most of all you want to prevent repeated handshakes, that's just a matter of using persistent HTTP connections (keep-alive)...? Another good option could be a RESTful batch API, which in the end helps you optimize more (e.g. database queries). Should you go for the WebSocket idea, the closest thing to a standard is JSON-RPC 2.0, I'd say. There are ready clients available for several languages. Depending on the amount of methods you'll support, consider providing a machine readable spec using OpenRPC.
  10. Angus Robertson

    ICS V9.0 - mobile platforms

    The TsslWebSocketCli is a very new component, not heard of any using it yet (I use the websocket server for dynamic web pages). What are you using it for? It will need the HTTPRest component, but that will be one of the first to be converted. Adding SSL to V10 is likely to be the hardest part due to the low level changes. Angus
  11. Really interesting! My main purpose is to have the WebSocket/Ssl modules working on my projects which target Android platform. I know that porting ICS V9.0 to Android is likely to be a more complex and time-consuming task. And by initially focusing on ICS V10, i can make quicker progress and gain valuable experience with the newer codebase but I would like to use / port "TSslWebSocketCli" with Ssl.
  12. Angus Robertson

    KeepAliveTimeSec of TSslHttpServer

    The websocket protocol has a keep-alive feature, if data is not being sent regularly, it is designed to be kept open. ICS does this for websocket client and server. ICS is quite capable of keeping sockets open for hours, but unless there is some traffic external routers and caches may decide the connection is dead and close it, I had to fix an FTP control channel issue where it was unexpectedly closed after a two hour upload of 50GB, needed to send keep-alives. That was annoying and time consuming, the 50GB uploads worked, but because the control channel was dead were considered failed. But here we are talking about a simple web server, the HTTP protocol allows keep-alive connections usually closing after a couple of idle minutes, I'm not aware it allows hours long connections without any traffic, and certainly the ICS web server is not designed or tested for that concept. Angus
  13. I want to implement a Delphi WebSocket server to send binary data (Stream and byte array) to javascript client. This could be done after receive a client message OR EVEN as unidirectional message so no client message need to be received. Below the pseudocode. var WSServer: TWSocketServer; Case A: I want to send back the binary data after receive a message WSServer.OnClientConnect := procedure (Sender: TObject; Client: TWSocketClient; Error: Word) begin TWebSockSrvClient(Client).OnWebSocketMessage := WebSocketMessage; end; procedure WebSocketMessage(Sender: TObject; Msg: string); var MemStream: TMemoryStream; SocketConn: IWebSocketConnection; begin //create and populate MemStream if (Msg = 'A') then begin SocketConn := TWebSocketSocket(Sender).getConnection; //I need to send back the MemStream but I found only these method: //SocketConn.sendString //SocketConn.sendFrame //SocketConn.sendMessage end; end; Case B: send binary data to some client from button click procedure TForm1.btnSendBufferClick(Sender: TObject); var ArrB: TBytes; begin ArrB := [1, 2, 3]; //I tried WSServer.Client[0].SendTB(ArrB) but is doesn't work end; I check OverbyteIcsWebSocketSrv.dpr demo but only strings are send. Any advice?
  14. Angus Robertson

    ICS V9.0 announced

    Surely those headers are sent with the WebSocket Upgrade request? Why send them again perhaps each second on the same TCP channel, what would the server do with them? Angus
  15. Angus Robertson

    ICS V9.0 announced

    I guess the point is the WebSockets protocol is supposed to be lightweight, and not cluttered with unnecessary headers. Why are you not sending the header information as WebSocket data packets. A configurable option would be needed to bypass that clean-up code. I'll put it on the list, but taking a break from ICS for a couple of weeks. Angus
  16. Full release notes for V9.0 will follow next week, meanwhile these are the main changes: New samples Samples/Delphi/SslInternet/OverbyteIcsSnippets.dpr - Small samples of codes for FTP, HTTP, sockets and email. Samples/Delphi/OtherDemos/OverbyteIcsNetMon.dpr - Internet Packet Monitoring Components, display packets and traffic using Npcap and raw sockets. Samples/Delphi/OtherDemos/OverbyteIcsNetTools.dpr - Network Tools Demo, uses all the main IP Helper functions, also TTIcsNeighbDevices, TIcsDomainNameCache, IcsDnsQueuy, TDnsQueryHttps, TIcsWhoisCli, TIcsIpChanges, TPing and TPingThread. Samples/Delphi/PlatformDemos/IcsHttpRestTstFmx.dproj - FMX HTTPS REST and OAuth, Send SMS and DNS over HTTPS functions demo. Samples/Delphi/PlatformDemos/IcsSslMultiWebServ.dproj - FMX Advanced multi host web server demo. Samples/Delphi/SslInternet/OverbyteIcsMQTTst.dpr - MQ Telemetry Transport message queuing service. Note this sample needs the VirtualTree component to be installed. Major sample updates for new components Samples/Delphi/SslInternet/OverbyteIcsHttpRestTst1.dpr - Uses TSslWebSocketCli for WebSocket Client, New embedded TOAuthLoginForm window using TOAuthBrowser for OAuth2 logins. Select client SSL certificate from the Windows Certificate Store. Samples/Delphi/SslInternet/OverbyteIcsSslMultiWebServ.dpr, OverbyteIcsDDWebService.dpr - Uses THttpWSSrvConn for WebSocket Server. IcsHosts can use server SSL certificate from the Windows Certificate Store. IcsHosts can now request a SSL certificate from the remote client. WebSocket server support. Uses TIcsDomainNameCache for multiple reverse DNS lookups. Samples/Delphi/SslInternet/OverbyteIcsPemTool.dpr - Can now export an SSL certificate from the Windows Certificate Store with its private key. Samples/delphi/OtherDemos/OverbyteIcsBatchDnsLookup.dpr - Uses TIcsDomainNameCache for multiple lookups. Samples/Delphi/SslInternet/OverbyteIcsSslMailSnd.dpr, OverbyteIcsSslMailRcv.dpr, OverbyteIcsMailQuTst.dpr - New embedded TOAuthLoginForm window using TOAuthBrowser for OAuth2 logins. Samples/delphi/OtherDemos/OverbyteIcsNsLookup.dpr - Uses single or multiple DNS servers, including built-in list of public servers, also sync requests. New Components TIcsDomainNameCache and TIcsDomNameCacheHttps - Cache forward and reverse DNS lookup requests, using several methods. TIcsMonSocket - Internet monitoring using raw sockets. TIcsMonPcap - Internet monitoring using Npcap NDIS driver. TIcsIpChanges - Monitors IP address changes dynamically. TIcsNeighbDevices - Builds historic LAN MAC device and IPv4 and IPv6 address table using ARP, neighbourhood and IP range scanning with reverse host lookup. TOAuthBrowser - OAuth authentication browser window VCL/FMX form. TSslWebSocketCli - WebSocket client protocol. TIcsMQTTServer and TIcsMQTTClient - MQ Telemetry Transport message queuing service, client and server. Major Component Upgrades TDnsQuery - Add synchronous methods and more response properties. Check multiple DNS server hosts including public DNS lists. TSslWSocketServer - IcsHosts can use server SSL certificate from the Windows Certificate Store. IcsHosts can now request a SSL certificate from the remote client. TIcsFtpMulti - Send NOOP command periodically during multi hour transfers so connections are not closed accidentally. New classes and Functions THttpWSSrvConn - WebSocket server protocol. Internet Helper Functions - Unit OverbyteIcsIpHlpApi.pas includes IpHlpConnsTable, IpHlpAdaptersInfo, IpHlpAdaptersAddr, IpHlpIpAddrTable, IpHlpIpNeighbTable, IpHlpIPForwardTable, IpHlpIpPathTable, IpHlpGetDnsServers, IpHlpIfTable2, IpHlpIPStatistics, IpHlpUDPStatistics and many other functions. TIcsMonFilterClass - Filter network traffic on protocols or IP addresses. TIcsTrafficClass - Maintains network traffic statistics by protocols and IP addresses. Angus
  17. plastkort

    Websockets

    Earlier I made my own version for a specific websocket connection, however now it seems that the service I connect to has changed something and I have no clue what. I can still connect to them using openSSH directly, however with my modified TSSLWsocket I can no longer connect, It just immediately disconnects with the error code 10053 (wsaeconnaborted) i tried to reboot routers and modems but still nothing. application I made was connected on another computer which eventually died the next time I tried to start it. so I suspect that i might need some other kind of websocket component, but hopefully I can still use TSSLWsocket, anyone here have something I can use ?
  18. plastkort

    Websockets

    Thanks, would there be any example source code I can check to see how this websocket works ?
  19. Angus Robertson

    Websockets

    I assume you are talking about a websocket client component, there is such a new component in ICS V8.71 not released yet but can be downloaded from the overnight zip or SVN. The new client is in OverbyteIcsWebSocketCli.pas with a sample in OverbyteIcsHttpRestTst.dpr (because it descends from the HTTP REST component). It's been tested against a couple of public websocket servers, and both of the ICS server implementations, one is new and built into the multi web server sample. It's also running on one of my public web sites, which the sample tests against. Angus
  20. Hey there! following the documentation of TWSocket.Addr, i tried to connect to a WebSocket "wss://ws.twelvedata.com/v1/quotes/price?apikey=api_key" using the "C:\Users\Public\...\icsv870\Samples\Delphi\SslInternet\OverbyteIcsSimpleSslCli64.dproj". without success. i always got error like: 'Winsock Resolve Host: Cannot convert host address 'wss://ws.twelvedata.com/v1/quotes/price?apikey=api_key' - Host not found (#11001)'. Processus OverbyteIcsSimpleSslCli.exe (25544) can you point me to the right direction? thx
  21. Angus Robertson

    How to connect to wss:// server ?

    The new websocket client component does not have a public or private Timer property, you will need to be more specific. There is FPeriodicTimer but that is internal use. Angus
  22. Angus Robertson

    Receiving TBytes

    Indeed, the OverbyteIcsIpStreamLog unit builds text lines by parsing a TByte buffer one character at a time. But many quick and dirty programs accept that TCP sends full packets, like my new WebSocket sample. The other advantage of TByte is avoidance of pointer handling, all those @ and ^ symbols that really have no place in modern applications since they can be abused so easily. Ditto the Move function. ICS simply offers alternatives, choose the easiest to use. Angus
  23. I accept the package structure for ICS is out of control, with over 280 dpk, dproj and cbproj files I have to update when I add a unit, even updating a single Delphi release is 10 or more packages. But for the same reason, changing it will take days of effort if we continue to support all versions of Delphi back to 7. Ideally an application should have been written years ago to create packages from a master file, as I did for the SSL/TLS root certificate packages, but it never happened. So changing it for ICS V8 is highly unlikely, but very probable for ICS V9 that will only support recent compilers so we can use new language features. Vincent's suggested package rules all make sense, for new projects. I used to create separate packages for my own ICS components without problems, but they are nearly all now part of the ICS distribution. Your MQTT project appears to be branched from the 10 year old https://github.com/pjde/delphi-mqtt and the simple way to avoid package problems in the future would be for the units and sample to be included with the ICS distribution, as I did with the new WebSocket unit recently. Angus
  24. Angus Robertson

    How to connect to wss:// server ?

    I've built the ICS V8.70 and now V8.71 packages on Delphi 11.2 dozens of times since September when it was released. The new WebSocket units are only in SVN and the overnight zip, not V8.70. The package says 11.0 because Embarcadero changed the naming scheme when releasing the first update to 11, but works with all versions of 11. Sorry, no idea why it wants to rebuild the RTL package. Angus
  25. Angus Robertson

    How to connect to wss:// server ?

    There was a new WebSocket server in SVN last week, sharing much code with the new client since WebSocket is a symmetrical service, and built into the existing web server samples running on port 443, rather than a separate port. Most of the methods and events are the same for client and server. The OverbyteIcsSslMultiWebServ and OverbyteIcsDDWebService samples should respond to these WebSocket URLs: wss://localhost/WebSocket/Echo (echoes messages received) wss://localhost/WebSocket/EchoPing (echo and send keep alive pings) wss://localhost/WebSocket/Chat?MyName (multi user chat server) There is a new websocketclient.html page listed on the main demo.html page that allows testing these WebSocket servers. The new client component will also access these URLs. I also have similar URLs on my public web server and anyone wants to test the client alone, but email for the full URL, I don't want it indexed. Angus
×