Example #1
0
func newSocketTransport(c context.Context) *http.Transport {
	return &http.Transport{
		Dial: func(net, addr string) (net.Conn, error) {
			c, err := socket.Dial(c, net, addr)
			if c != nil && err == nil {
				c.SetDeadline(time.Now().Add(1 * time.Hour))
			}
			return c, err
		},
	}
}