pass a conn to qtls that returns the remote address

This commit is contained in:
Marten Seemann
2019-03-25 16:59:35 +01:00
parent b2723d6d13
commit da4b3e3176
4 changed files with 37 additions and 2 deletions

View File

@@ -2,11 +2,32 @@ package handshake
import (
"crypto/tls"
"net"
"time"
"unsafe"
"github.com/marten-seemann/qtls"
)
type conn struct {
remoteAddr net.Addr
}
func newConn(remote net.Addr) net.Conn {
return &conn{remoteAddr: remote}
}
var _ net.Conn = &conn{}
func (c *conn) Read([]byte) (int, error) { return 0, nil }
func (c *conn) Write([]byte) (int, error) { return 0, nil }
func (c *conn) Close() error { return nil }
func (c *conn) RemoteAddr() net.Addr { return c.remoteAddr }
func (c *conn) LocalAddr() net.Addr { return nil }
func (c *conn) SetReadDeadline(time.Time) error { return nil }
func (c *conn) SetWriteDeadline(time.Time) error { return nil }
func (c *conn) SetDeadline(time.Time) error { return nil }
type clientSessionCache struct {
tls.ClientSessionCache
}