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
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

tcp_options_linux.go 512B

12345678910111213141516171819202122232425
  1. //go:build linux
  2. package essentials
  3. import (
  4. "fmt"
  5. "syscall"
  6. "golang.org/x/sys/unix"
  7. )
  8. func SetRawTCPWindowClamp(conn syscall.RawConn, value int) error {
  9. var err error
  10. if controlErr := conn.Control(func(fd uintptr) {
  11. err = unix.SetsockoptInt(int(fd), unix.IPPROTO_TCP, unix.TCP_WINDOW_CLAMP, value)
  12. }); controlErr != nil && err == nil {
  13. return fmt.Errorf("cannot access TCP socket: %w", controlErr)
  14. }
  15. if err != nil {
  16. return fmt.Errorf("cannot set TCP_WINDOW_CLAMP: %w", err)
  17. }
  18. return nil
  19. }