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
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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. }