Hi
I am writing a program that acts as a https_proxy and bypass the filtering by hiding original requests inside a fake HTTP request.
My problem is that I am not able to detect end of data during the SSL connection. Imagine I don't know what is the protocol (http/https/ftp or anything else), I want to make sure that I just read all data from socket.
I do not have any point to detect end of the data like "\r\n\r\n" which you can use in HTTP or FTP protocols to detect end of data.
I prepared a code to simulate what I am testing. It will listen on TCP/127.0.0.10:8080
My expectation is to see END in output of c++ code immediately, but you will never see it till you kill your curl command.
I already tried to read byte by byte and parse it.
Is there something that I am missing here?
Is my expectation correct from behavior of read()?
Read operation from socket will return zero only at end of stream and not before it. Here it was misunderstanding from my side, I expect to get zero immediately at end of message which is not possible.
Hi I am writing a program that acts as a https_proxy and bypass the filtering by hiding original requests inside a fake HTTP request. My problem is that I am not able to detect end of data during the SSL connection. Imagine I don't know what is the protocol (http/https/ftp or anything else), I want to make sure that I just read all data from socket. I do not have any point to detect end of the data like "\r\n\r\n" which you can use in HTTP or FTP protocols to detect end of data. I prepared a code to simulate what I am testing. It will listen on TCP/127.0.0.10:8080
Then simply set the http_proxy
and try to curl somewhere
My expectation is to see END in output of c++ code immediately, but you will never see it till you kill your curl command. I already tried to read byte by byte and parse it.
Is there something that I am missing here? Is my expectation correct from behavior of read()?