func (transport *Polling) HandleRequest(writer http.ResponseWriter, request *http.Request) {
	if !transport.running {
		return
	}

	if transport.originCheck != nil && !transport.originCheck(request) {
		writer.WriteHeader(http.StatusForbidden)
		return
	}

	method := request.Method
	codec := transport.createCodec(request)

	switch method {
	case "GET":
		transport.write(writer, codec)
	case "POST":
		transport.read(request.Body, codec)
	default:
		writer.WriteHeader(http.StatusMethodNotAllowed)
	}
}
// HandleRequest handles HTTP polling requests
HandleRequest handles HTTP polling requests
// HandleRequest handles HTTP polling requests
func (transport *Polling) HandleRequest(writer http.ResponseWriter, request *http.Request) {
	if !transport.running {
		return
	}
	if transport.originCheck != nil && !transport.originCheck(request) {
		writer.WriteHeader(http.StatusForbidden)
		return
	}
	method := request.Method
	codec := transport.createCodec(request)
	switch method {
	case "GET":
		transport.write(writer, codec)
	case "POST":
		transport.read(request.Body, codec)
	default:
		writer.WriteHeader(http.StatusMethodNotAllowed)
	}
}
func ( transport * Polling ) HandleRequest ( writer http . ResponseWriter , request * http . Request ) { if ! transport . running { return } if transport . originCheck != nil && ! transport . originCheck ( request ) { writer . WriteHeader ( http . StatusForbidden ) return } method := request . Method codec := transport . createCodec ( request ) switch method { case " " : transport . write ( writer , codec ) case " " : transport . read ( request . Body , codec ) default : writer . WriteHeader ( http . StatusMethodNotAllowed ) } }
HandleRequest handles HTTP polling requests
HandleRequest handles HTTP polling requests