Peter Kurfer
a720b0ee41
* supports HTTP * support TLS interception e.g. for HTTPS * support CA generation via cli * first draft of plugin API * support commands from plugins * includes Dockerfile * includes basic configuration
22 lines
412 B
Go
22 lines
412 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"net"
|
|
)
|
|
|
|
type proxyConn struct {
|
|
source net.Conn
|
|
target net.Conn
|
|
}
|
|
|
|
func (p *proxyConn) Close() error {
|
|
var err error
|
|
if targetErr := p.target.Close(); targetErr != nil {
|
|
err = fmt.Errorf("error while closing target conn: %w", targetErr)
|
|
}
|
|
if sourceErr := p.source.Close(); sourceErr != nil {
|
|
err = fmt.Errorf("error while closing source conn: %w", err)
|
|
}
|
|
return err
|
|
}
|