So recently I've been writing HTTP/1.1 client side protocol parsing stuff. Twice.
When I went through RFC2616, even shallow like I was doing (merely picking bits that I need to know to get my stuff working), I get the feeling of seeing through time. I saw where the protocol came from a simple, lined text based conversation protocol, with later session boundaries added (Content-Length), then connection control (Connection: keep-alive), then multiple responses with Transfer-Encoding: chunked (thankfully I didn't have to deal with multipart/form-data yet).
And only this time, SIMPLE doesn't necessarily mean "BEAUTIFUL". I saw ugly bits like "hex-coded, text based" chunk sizes, saw "1*DIGIT '/' 1*DIGIT" version number "e.g. HTTP/2.13", saw all the unspecification of behaviors.
I used to think that protocol definitions should not be in text but rather a state-machine of some language, preferably parsable, can be verified and interacted. Sometime I may pick up this idea later.
Anyway. One of the two (!) implementations I mentioned at the beginning, the Python Speedtest.net client, has been put on GitHub. Built upon asyncore, it provides similar tests you could take only with the Flash based test on their web. Credits goes to all the generous authors who released their sample code on the web, with credits in README.md.
Link: https://github.com/wolf0403/pySpeedtest
When I went through RFC2616, even shallow like I was doing (merely picking bits that I need to know to get my stuff working), I get the feeling of seeing through time. I saw where the protocol came from a simple, lined text based conversation protocol, with later session boundaries added (Content-Length), then connection control (Connection: keep-alive), then multiple responses with Transfer-Encoding: chunked (thankfully I didn't have to deal with multipart/form-data yet).
And only this time, SIMPLE doesn't necessarily mean "BEAUTIFUL". I saw ugly bits like "hex-coded, text based" chunk sizes, saw "1*DIGIT '/' 1*DIGIT" version number "e.g. HTTP/2.13", saw all the unspecification of behaviors.
I used to think that protocol definitions should not be in text but rather a state-machine of some language, preferably parsable, can be verified and interacted. Sometime I may pick up this idea later.
Anyway. One of the two (!) implementations I mentioned at the beginning, the Python Speedtest.net client, has been put on GitHub. Built upon asyncore, it provides similar tests you could take only with the Flash based test on their web. Credits goes to all the generous authors who released their sample code on the web, with credits in README.md.
Link: https://github.com/wolf0403/pySpeedtest