Lines 41,42,43,44 are the same in processSocks() and in processHttp() method. Should be extracted as separate method to avoid code duplication.