github.com/geph-official/geph2@v0.22.6-0.20210211030601-f527cb59b0df/libs/cryptrr/transport.go (about)

     1  package cryptrr
     2  
     3  // // Client encapsulates a CryptRR client transport.
     4  // type Client interface {
     5  // 	// RoundTrip sends a CiphMsg and returns a CiphMsg response.
     6  // 	RoundTrip(CiphMsg) (CiphMsg error)
     7  // }
     8  
     9  // // DomainFrontClient is an implementation of Client that uses POST requests to a domain-fronted endpoint
    10  // type DomainFrontClient struct {
    11  // 	// Endpoint should include the "fake" domain, for example https://ajax.aspnetcdn.com/
    12  // 	Endpoint string
    13  // 	// RealHost is the real host to put in the Host header, for example gephbinder.azureedge.net
    14  // 	RealHost string
    15  
    16  // 	once    sync.Once
    17  // 	hclient *http.Client
    18  // }
    19  
    20  // func (dft *DomainFrontClient) init() {
    21  // 	dft.once.Do(func() {
    22  // 		dft.hclient = &http.Client{
    23  // 			Transport: &http.Transport{
    24  // 				Proxy:           nil,
    25  // 				IdleConnTimeout: time.Second * 10,
    26  // 			},
    27  // 			Timeout: time.Second * 10,
    28  // 		}
    29  // 	})
    30  // }
    31  
    32  // // RoundTrip impl
    33  // func (dft *DomainFrontClient) RoundTrip(req CiphMsg) (resp CiphMsg, err error) {
    34  // 	dft.init()
    35  
    36  //}