Module Expr Str ImportFrom alias ImportFrom alias alias alias ImportFrom alias Import alias Import alias Import alias Import alias Import alias Import alias ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body For NameStore BinOpAdd BinOpAdd NameLoad NameLoad NameLoad body If CompareIn NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr If BoolOpOr BoolOpAnd CompareEq Call NameLoad NameLoad Num CompareGt BinOpSub NameLoad AttributeLoad NameLoad attr Num CompareGt BinOpSub NameLoad AttributeLoad NameLoad attr Num body Assign AttributeStore NameLoad attr NameLoad For NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr body If UnaryOpNot Call NameLoad NameLoad AttributeLoad NameLoad attr body Continue If CompareGt BinOpSub NameLoad AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If AttributeLoad NameLoad attr body If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad Call AttributeLoad NameLoad attr Index Num body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str SubscriptLoad Call AttributeLoad NameLoad attr Index Num Expr Call AttributeLoad NameLoad attr Return Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body For NameStore BinOpBitOr BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Assign TupleStore NameStore NameStore NameStore NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad For NameStore Call NameLoad BinOpAdd BinOpAdd NameLoad NameLoad NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr If BoolOpOr CompareIn NameLoad NameLoad CompareIn NameLoad NameLoad body For NameStore AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr If CompareEq SubscriptLoad NameLoad Index Num NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad For NameStore ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body If BoolOpAnd CompareEq NameLoad AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr body Break Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad If CompareEq NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareIn NameLoad AttributeLoad NameLoad attr body Assign TupleStore NameStore NameStore NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad For NameStore NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign TupleStore NameStore NameStore TupleLoad NameLoad TupleLoad NameLoad NameLoad TryExcept body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str SubscriptLoad NameLoad Index Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body TryExcept body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad handlers ExceptHandler type NameLoad body Return TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list
N/A N/A 
Copyright 2014 Google Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
 nogotofail.mitm.connection RedirectConnection nogotofail.mitm.connection.handlers.selector default_connection_selector default_ssl_connection_selector default_data_selector nogotofail.mitm util N/A socket N/A select N/A os N/A sys N/A logging N/A time Server N/A N/A N/A Server for handling creation and management of nogotofail.mitm.connection.Connections
     __init__ N/A N/A self port app_blame connection_class handler_selector ssl_handler_selector data_handler_selector block_non_clients ipv6 N/A RedirectConnection default_connection_selector default_ssl_connection_selector default_data_selector False False N/A N/A N/A self kill False N/A N/A self port port N/A N/A self read_fds N/A set N/A N/A self write_fds N/A set N/A N/A self ex_fds N/A set N/A N/A self _local_server_sockets N/A N/A N/A self fds N/A N/A N/A self connections N/A N/A N/A self connection_class connection_class N/A N/A self handler_selector handler_selector N/A N/A self ssl_handler_selector ssl_handler_selector N/A N/A self data_handler_selector data_handler_selector N/A N/A self app_blame app_blame N/A N/A self logger N/A N/A logging getLogger nogotofail.mitm N/A N/A self block_non_clients block_non_clients N/A N/A self ipv6 ipv6 N/A N/A self last_reap N/A N/A time time N/A start_listening N/A N/A self N/A N/A N/A N/A self _local_server_sockets N/A N/A self _create_server_sockets N/A sock N/A self _local_server_sockets N/A N/A N/A N/A N/A self read_fds add sock N/A select_fds N/A N/A self N/A N/A N/A N/A N/A self read_fds N/A self write_fds N/A self ex_fds N/A property on_select N/A N/A self r w x N/A N/A N/A fd N/A N/A r w x N/A N/A N/A fd N/A self _local_server_sockets N/A N/A N/A N/A self _on_server_socket_select fd N/A N/A N/A N/A self _on_connection_socket_select fd N/A now N/A N/A time time N/A N/A N/A N/A N/A len r 0 N/A N/A now N/A self last_reap 600 N/A N/A now N/A self last_reap 3600 N/A N/A N/A self last_reap now N/A conn N/A set N/A N/A N/A self connections values N/A N/A N/A N/A isinstance conn N/A self connection_class N/A N/A N/A N/A N/A now N/A conn last_used 3600 N/A N/A N/A N/A self remove conn N/A remove N/A N/A self connection N/A N/A N/A N/A N/A connection close handler_initiated False N/A N/A N/A self _remove_fds connection N/A setup_connection N/A N/A self client_socket N/A N/A N/A N/A self block_non_clients N/A N/A N/A N/A N/A N/A self app_blame client_available N/A N/A N/A client_socket getpeername N/A 0 N/A N/A N/A N/A N/A self logger debug Connection from non-client %s blocked N/A N/A N/A client_socket getpeername N/A 0 N/A N/A N/A client_socket close N/A N/A connection N/A N/A self connection_class self client_socket N/A self handler_selector N/A self ssl_handler_selector N/A self data_handler_selector N/A self app_blame N/A N/A N/A connection start N/A N/A N/A N/A self set_select_fds connection N/A shutdown N/A N/A self N/A N/A N/A sock N/A N/A N/A self read_fds N/A self write_fds N/A self ex_fds N/A N/A N/A N/A util close_quietly sock N/A set_select_fds N/A N/A self connection N/A N/A N/A Set the set of sockets for select based on connection.select_fds.

        If connection had previous fds being used those are removed and replaced with the
        current set in select_fds.
         N/A N/A N/A self _remove_fds connection N/A new_fds N/A connection select_fds N/A N/A N/A self fds N/A connection new_fds N/A N/A r w x new_fds N/A N/A N/A N/A self read_fds update r N/A N/A N/A N/A self write_fds update w N/A N/A N/A N/A self ex_fds update x N/A fd N/A set N/A N/A r w x N/A N/A N/A N/A self connections N/A fd connection N/A is_remote_mitm_server N/A N/A self host port N/A N/A N/A Check if the remote host:port is one of the MiTM server sockets.
        These connections should be avoided otherwise loops can be created where
        the MiTM tries to connect to the MiTM which then sees the remote as the MiTM
        and tries to connection and so on. This is best effort only, routing can still
        cause these loops.

        Returns if host:port belongs to one of the server sockets. N/A N/A local_v4 local_v6 N/A N/A util get_interface_addresses N/A N/A N/A host local_v4 N/A host local_v6 N/A N/A socket N/A self _local_server_sockets N/A N/A local N/A N/A socket getsockname N/A N/A N/A local N/A 1 port N/A N/A True N/A False N/A _create_server_sockets N/A N/A self N/A N/A N/A sockets N/A N/A family N/A N/A socket AF_INET N/A socket AF_INET6 N/A N/A N/A N/A family N/A socket AF_INET6 N/A N/A self ipv6 N/A N/A N/A local_server_socket N/A N/A socket socket family family N/A N/A family N/A socket AF_INET6 N/A N/A N/A N/A local_server_socket setsockopt N/A socket IPPROTO_IPV6 N/A socket IPV6_V6ONLY 1 N/A N/A N/A local_server_socket setsockopt N/A socket SOL_SOCKET N/A socket SO_REUSEADDR 1 N/A N/A N/A N/A self connection_class setup_server_socket local_server_socket N/A N/A N/A local_server_socket bind N/A N/A self port N/A N/A N/A local_server_socket listen 5 N/A N/A N/A sockets append local_server_socket N/A sockets N/A _remove_fds N/A N/A self connection N/A N/A N/A N/A connection N/A self fds N/A N/A N/A r w x N/A N/A self fds N/A connection N/A fd r N/A N/A N/A N/A N/A self read_fds remove fd N/A N/A N/A N/A self connections pop fd N/A fd w N/A N/A N/A N/A N/A self write_fds remove fd N/A N/A N/A N/A self connections pop fd N/A fd x N/A N/A N/A N/A N/A self ex_fds remove fd N/A N/A N/A N/A self connections pop fd N/A N/A N/A self fds N/A connection N/A _on_server_socket_select N/A N/A self fd N/A N/A N/A N/A client_socket client_address N/A None N/A None None N/A N/A N/A N/A client_socket client_address N/A N/A fd accept N/A N/A N/A self setup_connection client_socket N/A N/A N/A N/A socket error N/A e N/A N/A N/A N/A N/A self logger error N/A Socket error in connection startup from %s N/A client_address N/A 0 N/A N/A N/A N/A self logger exception e N/A N/A N/A util close_quietly client_socket N/A _on_connection_socket_select N/A N/A self fd N/A N/A N/A N/A N/A conn N/A N/A self connections N/A fd N/A N/A N/A KeyError N/A N/A N/A N/A N/A cont N/A N/A conn bridge fd N/A N/A cont N/A N/A N/A N/A self remove conn N/A N/A N/A Exception N/A e N/A N/A N/A N/A N/A self logger exception e N/A N/A N/A self remove conn N/A N/A