Add SplitHTTP Browser Dialer support (#3484)

This commit is contained in:
mmmray 2024-07-11 09:56:20 +02:00 committed by GitHub
parent 308f0c64c3
commit c8f6ba9ff0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 536 additions and 294 deletions

View file

@ -15,16 +15,14 @@ var _ buf.Writer = (*connection)(nil)
// connection is a wrapper for net.Conn over WebSocket connection.
type connection struct {
conn *websocket.Conn
reader io.Reader
remoteAddr net.Addr
conn *websocket.Conn
reader io.Reader
}
func newConnection(conn *websocket.Conn, remoteAddr net.Addr, extraReader io.Reader) *connection {
func NewConnection(conn *websocket.Conn, remoteAddr net.Addr, extraReader io.Reader) *connection {
return &connection{
conn: conn,
remoteAddr: remoteAddr,
reader: extraReader,
conn: conn,
reader: extraReader,
}
}
@ -92,7 +90,7 @@ func (c *connection) LocalAddr() net.Addr {
}
func (c *connection) RemoteAddr() net.Addr {
return c.remoteAddr
return c.conn.RemoteAddr()
}
func (c *connection) SetDeadline(t time.Time) error {