proxy.core.acceptor.acceptor module#

⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on Network monitoring, controls & Application development, testing, debugging.

  1. 2013-present by Abhinav Singh and contributors.


BSD, see LICENSE for more details.

class proxy.core.acceptor.acceptor.Acceptor(idd: int, fd_queue: multiprocessing.connection.Connection, flags: argparse.Namespace, lock: multiprocessing.synchronize.Lock, executor_queues: List[multiprocessing.connection.Connection], executor_pids: List[int], executor_locks: List[multiprocessing.synchronize.Lock], event_queue: Optional[proxy.core.event.queue.EventQueue] = None)[source]#

Bases: multiprocessing.context.Process

Work acceptor process.

On start-up, Acceptor accepts a file descriptor which will be used to accept new work. File descriptor is accepted over a fd_queue.

Acceptor goes on to listen for new work over the received server socket. By default, Acceptor will spawn a new thread to handle each work.

However, when --threadless option is enabled without --local-executor, Acceptor process will also pre-spawns a Threadless process during start-up. Accepted work is delegated to these Threadless processes. Acceptor process shares accepted work with a Threadless process over it’s dedicated pipe.

_recv_and_setup_socks() None[source]#
_start_local() None[source]#
_stop_local() None[source]#
_work(conn: socket.socket, addr: Optional[Tuple[str, int]]) None[source]#
accept(events: List[Tuple[selectors.SelectorKey, int]]) List[Tuple[socket.socket, Optional[Tuple[str, int]]]][source]#
run() None[source]#

Method to be run in sub-process; can be overridden in sub-class

run_once() None[source]#