Python Add TCP Congestion Control algorithm (Shadowsocks)

Python

Marks-Man

Administrator
Joined: Mar 15, 2021
Messages: 373
Resources: 213
Points: 28
Reaction score: 96
Edit "tcprelay.py"

Find:

Python:
self._remote_address = None
        fd_to_handlers[local_sock.fileno()] = self
        local_sock.setblocking(False)

add after it :

Python:
if sys.platform.startswith('linux') and 'cc_algo' in config:
            TCP_CONGESTION = getattr(socket, 'TCP_CONGESTION', 13)
            local_sock.setsockopt(socket.IPPROTO_TCP, TCP_CONGESTION, config['cc_algo'])

Then Compile, and add to your .json config "cc_algo" parameter, and use your preferred congestion controller ;)

:)
 
Last edited:
  • Tags
    add congestion controller project python shadowsocks
  • Top