MCPcopy Create free account
hub / github.com/M1r0ku/frp-Modify / GetHTTPSHostname

Function GetHTTPSHostname

frp-dev/pkg/util/vhost/https.go:35–47  ·  view source on GitHub ↗
(c net.Conn)

Source from the content-addressed store, hash-verified

33}
34
35func GetHTTPSHostname(c net.Conn) (_ net.Conn, _ map[string]string, err error) {
36 reqInfoMap := make(map[string]string, 0)
37 sc, rd := gnet.NewSharedConn(c)
38
39 clientHello, err := readClientHello(rd)
40 if err != nil {
41 return nil, reqInfoMap, err
42 }
43
44 reqInfoMap["Host"] = clientHello.ServerName
45 reqInfoMap["Scheme"] = "https"
46 return sc, reqInfoMap, nil
47}
48
49func readClientHello(reader io.Reader) (*tls.ClientHelloInfo, error) {
50 var hello *tls.ClientHelloInfo

Callers 1

TestGetHTTPSHostnameFunction · 0.85

Calls 1

readClientHelloFunction · 0.85

Tested by 1

TestGetHTTPSHostnameFunction · 0.68