Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DestinationServer ¶
type DestinationServer struct { // sni is the exact text from the SNI extension in ClientHello. SNI string // port is the destination port. Typically 443. Port int // An array of IP addresses for the server. IPs []string }
DestinationServer represents a target server for the application.
func (DestinationServer) HostsString ¶
func (s DestinationServer) HostsString(redirectIP string) (string, error)
HostsString is the representation of the svr. It can be pasted into the hosts file to redirect the endpoint to redirectIP. It does no format validation on redirectIP.
func (*DestinationServer) Lookup ¶
func (s *DestinationServer) Lookup(server string) error
Lookup does a DNS lookup on the server and populates the IPs field.
func (DestinationServer) String ¶
func (s DestinationServer) String() string
String is the stringer for the server.
type Servers ¶
type Servers map[string]DestinationServer
Servers is an alias for map[string]DestinationServer.
func ReadPCAP ¶
ReadPCAP reads a pcap file and returns a map of unpopulated servers. If useIP is false then we are going to use the IP addresses from the pcap and skip DNS lookups later.
func (Servers) Hosts ¶
Hosts creates the hosts file output for servers. Be sure to call PopulateServers() first if you have passed a DNS server to the app.
func (Servers) PopulateServers ¶
PopulateServers calls Populate on a map of servers.