26902 Initial code review

Created a branch from the very first commit to be able to review the whole code written so far.
This does not mean that a merge should be done after the review is done, this is a "dummy" pull request.
This will happen if enable_proxy is True or proxy_min_frame_size < 0 ? Having the same condition in two different if /elif clauses usually make things a bit hard to understand, could that be changed ?