{"record":{"id":"b5e0eaf9b623fdce","repo":"XTLS/Xray-core","slug":"failed-to-dispatch-request-b5e0ea","errorCode":null,"errorMessage":"failed to dispatch request","messagePattern":"failed to dispatch request","errorType":"exception","errorClass":"errors.Error","httpStatus":null,"severity":"error","filePath":"proxy/http/server.go","lineNumber":201,"sourceCode":"\tif buffer.Buffered() > 0 {\n\t\tpayload, err := buf.ReadFrom(io.LimitReader(buffer, int64(buffer.Buffered())))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treader = &buf.BufferedReader{Reader: reader, Buffer: payload}\n\t\tbuffer = nil\n\t}\n\n\tif inbound.CanSpliceCopy == 2 {\n\t\tinbound.CanSpliceCopy = 1\n\t}\n\tif err := dispatcher.DispatchLink(\n\t\tctx, dest, &transport.Link{\n\t\t\tReader: reader,\n\t\t\tWriter: buf.NewWriter(conn),\n\t\t},\n\t); err != nil {\n\t\treturn errors.New(\"failed to dispatch request\").Base(err)\n\t}\n\treturn nil\n}\n\nvar errWaitAnother = errors.New(\"keep alive\")\n\nfunc (s *Server) handlePlainHTTP(ctx context.Context, request *http.Request, writer io.Writer, dest net.Destination, dispatcher routing.Dispatcher) error {\n\tif !s.config.AllowTransparent && request.URL.Host == \"\" {\n\t\t// RFC 2068 (HTTP/1.1) requires URL to be absolute URL in HTTP proxy.\n\t\tresponse := &http.Response{\n\t\t\tStatus:        \"Bad Request\",\n\t\t\tStatusCode:    400,\n\t\t\tProto:         \"HTTP/1.1\",\n\t\t\tProtoMajor:    1,\n\t\t\tProtoMinor:    1,\n\t\t\tHeader:        http.Header(make(map[string][]string)),\n\t\t\tBody:          nil,\n\t\t\tContentLength: 0,","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/proxy/http/server.go#L183-L219","documentation":"Error \"failed to dispatch request\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at proxy/http/server.go:201 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}