You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
395 B
28 lines
395 B
package main
|
|
|
|
import (
|
|
"io"
|
|
"net"
|
|
)
|
|
|
|
type mitmListener struct {
|
|
conn net.Conn
|
|
}
|
|
|
|
func (listener *mitmListener) Accept() (net.Conn, error) {
|
|
if listener.conn != nil {
|
|
conn := listener.conn
|
|
listener.conn = nil
|
|
return conn, nil
|
|
} else {
|
|
return nil, io.EOF
|
|
}
|
|
}
|
|
|
|
func (listener *mitmListener) Close() error {
|
|
return nil
|
|
}
|
|
|
|
func (listener *mitmListener) Addr() net.Addr {
|
|
return nil
|
|
}
|
|
|