Documentation ¶
Overview ¶
Package badproxy implements misbehaving proxies. We have a single CensoringProxy that exports two misbehaving endpoints. Each endpoint implements a different proxy-censorsing technique. The first one reads some bytes from the connection then closes the connection. The other instead replies with a self signed x509 certificate.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CensoringProxy ¶
type CensoringProxy struct {
// contains filtered or unexported fields
}
CensoringProxy is a proxy that does not behave correctly.
func NewCensoringProxy ¶
func NewCensoringProxy() *CensoringProxy
NewCensoringProxy creates a new instance of a misbehaving proxy.
func (*CensoringProxy) Start ¶
func (p *CensoringProxy) Start(address string) (net.Listener, error)
Start starts the misbehaving proxy for TCP. This endpoint will read some bytes from the request and then close the connection. This behaviour is implemented by a bunch of censoring proxy around the world. Usually such proxies only close the connection with offending SNIs/Host headers.
func (*CensoringProxy) StartTLS ¶
func (p *CensoringProxy) StartTLS(address string) (net.Listener, *x509.Certificate, error)
StartTLS starts the misbehaving proxy for TLS. This endpoint will return to the client a self signed certificate. Thus, it models the case where a MITM forces users to accept a rogue certificate. After sending such a certificate, this proxy will close the TCP connection.