So my problem is, i wrote a Websocket server on my Arduino and my Delphi client can't connect to that, because the connection is refused (error 10061). I wrote the first test program in Python, everything worked fine, so the problem is not on the Arduino's side. In Delphi I use TClientSocket and this is my code below:
The Arduino's IP address is: 192.168.0.24. The server listen's on the port 80 but i already tried to change that to 6667 and the client's port to 6667 but still nothing.
I am using Delphi 11 and RAD studio. What am I doing wrong?
You either specify an address (IP) or a host. TClientSocket cannot understand URI's like "ws://192.168.0.24". I suggest you either set Client.Address:= '192.168.0.24'; or Client.Host:= 'localhost';. Setting the host will allow IP address to change without breaking the program.
I cannot see your python code, so I do not know what might differ. The error you get i Delphi is related to an attempt to connect to a port which is not listening.