package
0.7.0-alpha
Repository: https://github.com/refraction-networking/water.git
Documentation: pkg.go.dev

# README

socket

This package provides some helper function to abuse network sockets and do weird things, including but not limited to:

  • Spawning connection pairs
  • Wrap a readable/writable interface into a net.Conn

# Functions

TCPConnFileWrap wraps an object into a *os.File from an underlying net.TCPConn.
TCPConnPair returns a pair of connected net.TCPConn.
TCPConnWrap wraps an io.Reader/io.Writer/io.Closer interface into a TCPConn.
UnixConnFileWrap wraps an object into a *os.File from an underlying net.UnixConn.
UnixConnPair returns a pair of connected net.UnixConn.
UnixConnWrap wraps an io.Reader/io.Writer/io.Closer interface into a UnixConn.