proxyproto

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package proxyproto provides a net.Listener that reads an optional PROXY-protocol v1 header (the text format Xray emits with xver=1) from each accepted connection and exposes the real client address via RemoteAddr.

The panel's HTTP server sits behind Xray, which terminates TLS and forwards the decrypted request over loopback — so without this the panel only ever sees 127.0.0.1. Connections that arrive WITHOUT a PROXY header (anything not routed through the xver fallback) pass through unchanged, keeping their real transport address, so the wrapper is safe to install unconditionally.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

type Listener struct{ net.Listener }

Listener wraps a net.Listener, parsing a PROXY v1 header off each connection.

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

Accept returns a connection that lazily parses its PROXY header on first use.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL