An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 4.7% dependent repos on proxy.golang.org

proxy.golang.org : github.com/topfreegames/viaproxy

Package viaproxy provides the ability to manage connections that properly understand the Proxy Protocol defined by Willy Tarreau for HAProxy. Regular net.Conn structures will return the "wrong" RemoteAddr when used behind a proxy: the remote address informed will be the one of the proxy, not the one from the client initiating the connection to the proxy. This package adds a wrapper for regular net.Conn that checks for the existence of the proxy protocol line and if present, return a net.Conn that reports the customer address when calling RemoteAddr. This wrapped connection can be casted to *viaproxy.Conn to add access to an additional ProxyAddr method that will return the proxy's address. In order to use this extended connection type we can call Wrap on an existing connection: Package viaproxy also provides a Listener struct that already returns viaproxy.Conn connections when calling AcceptFromProxy: The Accept method in the Listener struct returns a generic net.Conn which can safely be casted to a viaproxy.Conn: Using viaproxy.Conn objects whenever a net.Conn is expected should be safe in all cases. If you encounter an issue please send a bug report to https://github.com/topfreegames/viaproxy/issues

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/topfreegames/viaproxy
License: MIT
Latest release: over 6 years ago
First release: over 6 years ago
Namespace: github.com/topfreegames
Dependent repositories: 1
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 10 days ago