func ParseResponseHeader(raw []byte) (resp *http.Response, rest []byte, err error) {
	if len(raw) == 0 {
		return nil, nil, nil
	}
	if len(raw) < 16 {
		return nil, raw, fmt.Errorf("http: invalid response header length")
	}
	if !bytes.Equal(raw[:4], []byte("HTTP")) {
		return nil, raw, fmt.Errorf("http: invalid protocol name '%s'", raw[:4])
	}
	if raw[4] != '/' {
		return nil, raw, fmt.Errorf("http: invalid protocol separator '%c'", raw[4])
	}
	if raw[6] != '.' {
		return nil, raw, fmt.Errorf("http: invalid version separator '%c'", raw[6])
	}
	ilf := bytes.Index(raw, []byte{'\n'})
	if ilf < 0 || raw[ilf-1] != '\r' {
		return nil, raw, fmt.Errorf("http: missing CRLF on status line")
	}
	resp = &http.Response{
		Proto:      string(raw[:8]),
		ProtoMajor: int(raw[5] - 48),
		ProtoMinor: int(raw[7] - 48),
		Status:     string(raw[9 : ilf-1]),
	}
	if resp.ProtoMajor <= 0 || resp.ProtoMajor > 2 {
		return nil, raw, fmt.Errorf("http: invalid major version '%c'", raw[5])
	}
	if resp.ProtoMinor < 0 || resp.ProtoMinor > 1 {
		return nil, raw, fmt.Errorf("http: invalid minor version '%c'", raw[7])
	}
	resp.StatusCode, err = strconv.Atoi(string(raw[9:12]))
	if err != nil {
		return nil, raw, fmt.Errorf("http: status code: " + err.Error())
	}
	if resp.StatusCode < 100 || resp.StatusCode >= 600 {
		return nil, raw, fmt.Errorf("http: invalid status code '%s'", raw[9:12])
	}
	rest = raw[ilf+1:]
	resp.Header, rest, err = parseHeaders(rest)
	if err != nil {
		return nil, raw, err
	}
	return resp, rest, nil
}
ParseResponseHeader parse HTTP response header and return it as standard
HTTP Response with unreaded packet.
package http
import (
	"bytes"
	"fmt"
	"net/http"
	"strconv"
	libio "github.com/shuLhan/share/lib/io"
)