Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

sockopts_congestion.go 626B

1234567891011121314151617181920
  1. //go:build linux
  2. package network
  3. import (
  4. "syscall"
  5. "golang.org/x/sys/unix"
  6. )
  7. // setCongestionControl sets BBR as the TCP congestion control algorithm.
  8. // BBR provides better throughput over lossy and high-latency links compared
  9. // to the default cubic, which is especially beneficial for mobile and
  10. // home internet clients. This is best-effort: silently ignored if the
  11. // kernel does not have tcp_bbr available.
  12. func setCongestionControl(conn syscall.RawConn) {
  13. conn.Control(func(fd uintptr) { //nolint: errcheck
  14. unix.SetsockoptString(int(fd), unix.IPPROTO_TCP, unix.TCP_CONGESTION, "bbr") //nolint: errcheck
  15. })
  16. }