Documentation ¶
Index ¶
- func ConnToHTTP(src net.Conn, destReq *http.Request, destRes http.ResponseWriter) error
- func CopyUDPAddr(addr *net.UDPAddr) *net.UDPAddr
- func GetAddr(addr string) string
- func GetClustersFriends(clusterPort int, routes []*url.URL) ([]*url.URL, error)
- func GetInterfaceIPs() ([]net.IP, error)
- func GetMainIP() (string, error)
- func GetMainIPByInterface() (string, error)
- func GetURLIP(ipStr string) ([]net.IP, error)
- func HTTPToConn(srcReq *http.Request, srcRes http.ResponseWriter, dest net.Conn) error
- func IsIPInList(list1 []net.IP, list2 []net.IP) bool
- func LoadTLS(cert string, key string, ca string) (*tls.Config, error)
- func MakeListener(protocol string, addr string, conf *tls.Config) (net.Listener, error)
- func NewConn(protocol string, addr string) (net.Conn, error)
- func NewHTTPServer(l net.Listener, handle http.Handler, c *tls.Config) (*http.Server, net.Listener, error)
- func NewKeepAliveListener(tl *net.TCPListener) net.Listener
- func ProxyHTTPRequest(src net.Conn, dest net.Conn) error
- func TCPListener(addr string, conf *tls.Config) (net.Listener, error)
- func TLSCipher(cs uint16) string
- func TLSConn(protocol string, addr string, conf *tls.Config) (*tls.Conn, error)
- func TLSFromConn(tl *tls.Conn, addr string) (*tls.Conn, error)
- func TLSVersion(ver uint16) string
- func UpgradeConnToTLS(conn net.Conn, cm *tls.Config) (net.Conn, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnToHTTP ¶
ConnToHTTP proxies a requests from a net.Conn to a destination request, writing the response to provided ResponseWriter.
func CopyUDPAddr ¶
CopyUDPAddr returns a new copy of a giving UDPAddr.
func GetAddr ¶
GetAddr takes the giving address string and if it has no ip or use the zeroth ip format, then modifies the ip with the current systems ip.
func GetClustersFriends ¶
GetClustersFriends returns a giving set of routes from the provided port number.
func GetInterfaceIPs ¶
GetInterfaceIPs returns the list of IP of the giving interfaces found in the system.
func GetMainIP ¶
GetMainIP returns the giving system IP by attempting to connect to a imaginary ip and returns the giving system ip.
func GetMainIPByInterface ¶
GetMainIPByInterface returns the giving ip of the current system by looping through all interfaces returning the first ipv4 found that is not on the loopback interface.
func HTTPToConn ¶
HTTPToConn proxies a src Request to a net.Con connection and writes back the response to the src Response.
func IsIPInList ¶
IsIPInList returns true/false if the giving ip list were equal.
func MakeListener ¶
MakeListener returns a new net.Listener requests.
func NewHTTPServer ¶
func NewHTTPServer(l net.Listener, handle http.Handler, c *tls.Config) (*http.Server, net.Listener, error)
NewHTTPServer returns a new http.Server using the provided listener
func NewKeepAliveListener ¶
func NewKeepAliveListener(tl *net.TCPListener) net.Listener
NewKeepAliveListener returns a new net.Listener from underline net.TCPListener where produced net.Conns respect keep alive regualations.
func ProxyHTTPRequest ¶
ProxyHTTPRequest copies a http request from a src net.Conn connection to a destination net.Conn.
func TCPListener ¶
TCPListener returns a new net.Listener requests.
func TLSFromConn ¶
TLSFromConn returns a new tls.Conn using the address and the certicates from the provided *tls.Conn.
func TLSVersion ¶
TLSVersion returns a string version number based on the tls version int.
Types ¶
This section is empty.