Thanks bbraun for the help! I now understand better!
I changed to your advice. I started to use nc, the "Swiss knife" network tool. This is indeed more transparent.
I started it up as a kind of mini web server with the command:
This will send the file index.html with an HTTP header to anything what connects to port 84. This could also be my TCPExample. I tested it first with nc itself in an other console:
Then I edited my pascal code like this:
Test the new executable:
TCPExample as a Browser App.zip
See all the code:
TCPExample as a Browser.zip
Now I'm on my way!
I would like to know if I can switch the current code to something what listens to a port and sendout a file if asked. Just like nc is doing in my mini web server?
I changed to your advice. I started to use nc, the "Swiss knife" network tool. This is indeed more transparent.
I started it up as a kind of mini web server with the command:
Code:
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; cat index.html; } | nc -l 84; done
Code:
nc localhost 84
Code:
const
dest_name = 'live.net2service.com';
dest_port = 84;
nul = chr(0);
lf = chr(10);
cr = chr(13);
TCPExample as a Browser App.zip
See all the code:
TCPExample as a Browser.zip
Now I'm on my way!
I would like to know if I can switch the current code to something what listens to a port and sendout a file if asked. Just like nc is doing in my mini web server?