golang之http请求的dns解析代码流程

Posted llok

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了golang之http请求的dns解析代码流程相关的知识,希望对你有一定的参考价值。

src/net/http/client.go
func (c *Client) do(req *Request) (retres *Response, reterr error)


src/net/http/client.go
func (c *Client) send(req *Request, deadline time.Time) (resp *Response, didTimeout func() bool, err error)


src/net/http/client.go
func send(ireq *Request, rt RoundTripper, deadline time.Time) (resp *Response, didTimeout func() bool, err error)


src/net/http/roudtrip.go
func (t *Transport) RoundTrip(req *Request) (*Response, error)


src/net/http/transport.go
func (t *Transport) roundTrip(req *Request) (*Response, error)


src/net/http/transport.go
func (t *Transport) getConn(treq *transportRequest, cm connectMethod) (pc *persistConn, err error)


src/net/http/transport.go
func (t *Transport) queueForDial(w *wantConn)


src/net/http/transport.go
func (t *Transport) dialConnFor(w *wantConn)


src/net/http/transport.go
func (t *Transport) dialConn(ctx context.Context, cm connectMethod) (pconn *persistConn, err error)


src/net/http/transport.go
func (t *Transport) dial(ctx context.Context, network, addr string) (net.Conn, error)


src/net/dial.go
func (d *Dialer) DialContext(ctx context.Context, network, address string) (Conn, error)


src/net/dial.go
func (r *Resolver) resolveAddrList(ctx context.Context, op, network, addr string, hint Addr) (addrList, error)


src/net/ipsock.go
func (r *Resolver) internetAddrList(ctx context.Context, net, addr string) (addrList, error)


src/net/lookup.go
func (r *Resolver) lookupIPAddr(ctx context.Context, network, host string) ([]IPAddr, error)

  

以上是关于golang之http请求的dns解析代码流程的主要内容,如果未能解决你的问题,请参考以下文章

golang学习十一: 网络编程之HTTP

谢烟客---------Linux之DNS请求流程及资源记录定义

golang实现dns域名解析:响应报文分析

『GCTT 出品』用不到 100 行的 Golang 代码实现 HTTP(S) 代理

除了解析域名,DNS还能干吗?

golang基础-http请求的几种方式