# Functions
ChangeMaxPayloadSize is used to change max payload size and fill it with pseudorandom content.
ClearResolveCache clears the DNS cache for cached-rr resolution mode.
Copy is a debug version of io.Copy without the zero Copy optimizations.
DebugSummary returns a string with the size and escaped first max/2 and last max/2 bytes of a buffer (or the whole escaped buffer if small enough).
GeneratePayload generates a payload with given inputs.
GenerateRandomPayload generates a random payload with given input size.
GetPort extracts the port for TCP sockets and the path for Unix domain sockets.
GetUniqueUnixDomainPath returns a path to be used for Unix domain socket.
Listen returns a listener for the port.
NetCat connects to the destination and reads from in, sends to the socket, and write what it reads from the socket to out.
NormalizeHostPort generates host:port string for the address or uses localhost instead of [::] when the original port binding input didn't specify an address.
NormalizePort parses port and returns host:port if port is in the form of host:port already or :port if port is only a port (doesn't contain :).
Proxy starts a TCP proxy.
ProxyToDestination opens a proxy from the listenPort (or addr:port or Unix domain socket path) and forwards all traffic to destination (host:port).
ReadFileForPayload reads the file from given input path.
Resolve backward compatible TCP only version of ResolveByProto.
ResolveAll returns all the IPs for the host.
ResolveByProto returns the address of the host,port suitable for net.Dial.
ResolveDestination returns the TCP address of the "host:port" suitable for net.Dial.
ResolveDestinationInternal returns the address of the "host:port" suitable for net.Dial.
SetSocketBuffers sets the read and write buffer size of the socket.
SmallReadUntil will read one byte at a time until stopByte is found and up to max bytes total.
TCPEchoServer starts a TCP Echo Server on given port, name is for logging.
TCPResolveDestination returns the TCP address of the "host:port" suitable for net.Dial.
UDPEchoServer starts a UDP Echo Server on given port, name is for logging.
UDPListen starts server on given port.
UDPNetCat handles UDP part of NetCat.
UDPResolveDestination returns the UDP address of the "host:port" suitable for net.Dial.
ValidatePayloadSize compares input size with MaxPayLoadSize.
# Constants
DefaultGRPCPort is the Fortio gRPC server default port number.
GET is a constant value that indicates HTTP method as GET.
POST is a constant value that indicates HTTP method as POST.
PrefixHTTP is a constant value for representing HTTP protocol that can be added prefix of URL.
PrefixHTTPS is a constant value for representing secure HTTPS protocol that can be added prefix of URL.
StandardHTTPPort is the Standard HTTP port number.
StandardHTTPSPort is the Standard HTTPS port number.
UDPPrefix is the prefix that given to NetCat switches to UDP from TCP(/unix domain) socket type.
UnixDomainSocket type for network addresses.
# Variables
ErrNilDestination returned when trying to proxy to a nil address.
FlagResolveIPType indicates which IP types to resolve.
FlagResolveMethod decides which method to use when multiple IPs are returned for a given name default assumes one gets all the IPs in the first call and does round-robin across these.
KILOBYTE is a constant for kilobyte (i.e., 1024).
MaxPayloadSize is the maximum size of payload to be generated by the EchoHandler size= argument.
Payload that is returned during echo call.
# Structs
HostPortAddr is the missing base.