func DialWithDialerContext(ctx context.Context, network, address string, dialer net.Dialer) (fcgi *FCGIClient, err error) {
	var conn net.Conn
	conn, err = dialer.DialContext(ctx, network, address)
	if err != nil {
		return
	}
	fcgi = &FCGIClient{
		rwc:       conn,
		keepAlive: false,
		reqID:     1,
	}
	return
}
DialWithDialerContext connects to the fcgi responder at the specified network address, using custom net.Dialer
and a context.
See func net.Dial for a description of the network and address parameters.
package fastcgi
import (
	"bufio"
	"bytes"
	"context"
	"encoding/binary"
	"errors"
	"io"
	"io/ioutil"
	"mime/multipart"
	"net"
	"net/http"
	"net/http/httputil"
	"net/textproto"
	"net/url"
	"os"
	"path/filepath"
	"strconv"
	"strings"
	"sync"
	"time"
)
const FCGIListenSockFileno uint8 = 0
const FCGIHeaderLen uint8 = 8
const Version1 uint8 = 1
const FCGINullRequestID uint8 = 0
const FCGIKeepConn uint8 = 1
const (
	BeginRequest uint8 = iota + 1
	AbortRequest
	EndRequest
	Params
	Stdin
	Stdout
	Stderr
	Data
	GetValues
	GetValuesResult
	UnknownType
	MaxType = UnknownType
)
const (
	Responder uint8 = iota + 1
	Authorizer
	Filter
)
const (
	RequestComplete uint8 = iota
	CantMultiplexConns
	Overloaded
	UnknownRole
)
const (
	MaxConns string = "MAX_CONNS"
	MaxRequests string = "MAX_REQS"
	MultiplexConns string = "MPXS_CONNS"
)
const (
	maxWrite = 65500  
	maxPad   = 255
)
type header struct {
	Version       uint8
	Type          uint8
	ID            uint16
	ContentLength uint16
	PaddingLength uint8
	Reserved      uint8
}
var pad [maxPad]byte
func (h *header) init(recType uint8, reqID uint16, contentLength int) {
	h.Version = 1
	h.Type = recType
	h.ID = reqID
	h.ContentLength = uint16(contentLength)
	h.PaddingLength = uint8(-contentLength & 7)
}
type record struct {
	h    header
	rbuf []byte
}
func (rec *record) read(r io.Reader) (buf []byte, err error) {
	if err = binary.Read(r, binary.BigEndian, &rec.h); err != nil {
		return
	}
	if rec.h.Version != 1 {
		err = errors.New("fcgi: invalid header version")
		return
	}
	if rec.h.Type == EndRequest {
		err = io.EOF
		return
	}
	n := int(rec.h.ContentLength) + int(rec.h.PaddingLength)
	if len(rec.rbuf) < n {
		rec.rbuf = make([]byte, n)
	}
	if _, err = io.ReadFull(r, rec.rbuf[:n]); err != nil {
		return
	}
	buf = rec.rbuf[:int(rec.h.ContentLength)]
	return
}
type FCGIClient struct {
	mutex     sync.Mutex
	rwc       io.ReadWriteCloser
	h         header
	buf       bytes.Buffer
	stderr    bytes.Buffer
	keepAlive bool
	reqID     uint16
}