ws/internal/http/upgrade/request/types.go

33 lines
641 B
Go

package request
import "git.xdrm.io/go/websocket/internal/http/upgrade/response"
// If origin is required
const bypassOriginPolicy = true
// T represents an HTTP Upgrade request
type T struct {
first bool // whether the first line has been read (GET uri HTTP/version)
// status code
code response.StatusCode
// request line
request RequestLine
// data to check origin (depends of reading order)
host string
port uint16 // 0 if not set
origin string
validPolicy bool
// ws data
key []byte
protocols [][]byte
// required fields check
hasConnection bool
hasUpgrade bool
hasVersion bool
}