basic server

Hi,

Could you explain me how to send a file to the browser that connects to my server and requests GET /index.html? Do I open the file index.html and send it through the socket? What parameters should I use in write(client_fd, ???, ???) to send the file index.html to the browser?

Thanks!

I must open the requested file and perform fread() from the file followed by write() to the socket, until fread returns 0... I'm doing this in blocks of 1024 (don't ask me why?!?)

Thanks anyway! :cool: