whimsical1987 0 Newbie Poster

Hi,

I am new to python programming. I am interested in writing a HTTP proxy using poll or twisted. I know how the tunnel works but I am not sure of starting the code. I need help from experts to complete the programming.

As far as I know a tunnel acts as both client and server. When a client requests for a page the tunnel acts as a server accepting the request from the client and then it forwards the connection to the web server then passes the request back to the client.

I am not sure of how many sockets to create. Do I need to write the program in a single file or should I have two file for client and a server. I am thinking of creating 2 sockets then connect to the client with the socket and then connect to the server with other socket and forward the request to the server. I don't know whether I am right or wrong. I need help to continue with the process.

Thanks. Help from the experts is appreciated.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.