PDA

View Full Version : Connecting to servers (sockets?)



Muscovy
07-02-2009, 07:44 PM
How, in C++, do you get files from something like a standard http server? Say I'm trying to get the file from downloads.example.org/package.tar.gz .
I assume you can do that, all I've managed to read so far suggests the server needs to be specially set up.

dwks
07-03-2009, 04:33 PM
I'd imagine you'd establish a connection to the standard HTTP port (80) and then send an HTTP request. I don't know the format for that, but you can probably find it online.

BTW, you could use the program wget to simplify this, because it will do all the HTTP work for you, and you can just execute "wget http://google.ca/".

And the server is specially set up. It has to be running the HTTP daemon. :)

Muscovy
07-03-2009, 05:09 PM
By 'the http daemon', do you mean the sort of thing that is essentially any http server?
What I want to know is if servers I connect to need to be Linux friendly or simmilar.