2018-08-27 00:06:40 +08:00
|
|
|
package adapters
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
// NewHTTPS is HTTPAdapter generator
|
|
|
|
func NewHTTPS(request *http.Request, conn net.Conn) *SocketAdapter {
|
2019-02-02 21:03:13 +08:00
|
|
|
metadata := parseHTTPAddr(request)
|
|
|
|
metadata.SourceIP = parseSourceIP(conn)
|
2018-08-27 00:06:40 +08:00
|
|
|
return &SocketAdapter{
|
2019-02-02 21:03:13 +08:00
|
|
|
metadata: metadata,
|
2018-09-30 12:25:52 +08:00
|
|
|
conn: conn,
|
2018-08-27 00:06:40 +08:00
|
|
|
}
|
|
|
|
}
|