// +build gofuzz package viaproxy import ( "bytes" "io" "net" ) // from conn_test.go type conn struct { net.Conn data io.Reader } func (c *conn) Read(b []byte) (n int, err error) { return c.data.Read(b) } func (c *conn) LocalAddr() net.Addr { return &net.TCPAddr{IP: net.ParseIP("127.0.0.1"), Port: 9876} } func (c *conn) RemoteAddr() net.Addr { return &net.TCPAddr{IP: net.ParseIP("10.0.1.2"), Port: 1234} } func testConn(data []byte) net.Conn { return &conn{data: bytes.NewReader(data)} } func Fuzz(data []byte) int { conn := testConn(data) if _, err := Wrap(conn); err != nil { return 0 } return 1 }