I must develop proxy server that work with only HTTP 1.0 in Linux and by c . I need some hint to start developing .
+4
A:
How to create a proxy server:
- Open a port to listen on
- Catch all incoming requests on that report
- Determine the web address requested
- Open a connection to the host and forward the request
- Receive response
- Send the response back to the requesting client
Additionally: Use threads to allow for multiple requests to the server.
monksy
2009-11-15 11:41:44
+11
A:
- I assume you are confident in using linux and the language c (no hints for that, else don't start with developing a proxy)
- Read and understand the RFC 1945 HTTP/1.0 (pay attention to the specific mentioning of proxy)
- Determine what kind of proxy you want (web/caching/content-filter/anonymizer/transparent/non-transparent/reverse/gateway/tunnel/...)
- Start developing the server
Basic steps
- Open port
- Listen on port
- Get all request sent from the client to that port (maybe make the whole thing multithreaded to be able to handle more than 1 request at a time)
- Determine if it is a valid HTTP 1.0 request
- Extract the request components
- Rebuild the request according to what type of proxy you are
- Send the new request
- Get the response
- Send response to client
jitter
2009-11-15 11:46:01
+1 for being tolerant and at least trying to provide a helpful answer.
Tim Post
2009-11-15 12:25:19
"Send response to client" how to ? with table ? which information must be saved ?
SjB
2009-11-20 20:16:41
+2
A:
How to create a proxy server:
- Download Squid Cache.
- Modify as required.
brianegge
2009-11-15 12:11:44