gitea源码

util.go 394B

123456789101112131415
  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package proxyprotocol
  4. import "io"
  5. var localHeader = append(v2Prefix, '\x20', '\x00', '\x00', '\x00', '\x00')
  6. // WriteLocalHeader will write the ProxyProtocol Header for a local connection to the provided writer
  7. func WriteLocalHeader(w io.Writer) error {
  8. _, err := w.Write(localHeader)
  9. return err
  10. }