Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 3 additions & 45 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package config

import (
"strings"
"time"

"github.com/roadrunner-server/http/v6/servers/fcgi"
"github.com/roadrunner-server/http/v6/servers/http3"
Expand All @@ -14,16 +13,16 @@ import (

// Config configures RoadRunner HTTP server.
type Config struct {
// RawBody if turned on, RR will not parse the incoming HTTP body and will send it as is
RawBody bool `mapstructure:"raw_body"`
// Host and port to handle as http server.
Address string `mapstructure:"address"`
// AccessLogs turn on/off, logged at Info log level, default: false
AccessLogs bool `mapstructure:"access_logs"`
// List of the middleware names (order will be preserved)
Middleware []string `mapstructure:"middleware"`
// Pool configures worker pool (lifecycle only; requests are delivered via Proxy).
// Pool configures worker pool.
Pool *pool.Config `mapstructure:"pool"`
// Proxy configures the worker-facing ConnectRPC server.
Proxy *Proxy `mapstructure:"proxy"`
// InternalErrorCode used to override default 500 (InternalServerError) http code
InternalErrorCode uint64 `mapstructure:"internal_error_code"`
// MaxRequestSize specified max size for payload body in megabytes. 0 = 1GB.
Expand All @@ -43,33 +42,6 @@ type Config struct {
GID int
}

// Proxy configures the ConnectRPC server that PHP workers connect into.
type Proxy struct {
// Address is the TCP address the proxy server listens on, e.g. ":7070".
Address string `mapstructure:"address"`
// RequestTimeout caps how long a single request can sit waiting for a
// worker to produce a response. Defaults to 60s.
RequestTimeout time.Duration `mapstructure:"request_timeout"`
// InboxSize bounds the in-process request queue. Submits beyond this
// return 503 to the client. Defaults to 1024.
InboxSize int `mapstructure:"inbox_size"`
// DebugMode flips the handler into debug mode (verbose error bodies on 5xx).
DebugMode bool `mapstructure:"debug"`
}

func (p *Proxy) InitDefaults() {
if p.Address == "" {
// Bind to loopback by default
p.Address = "127.0.0.1:7070"
}
if p.RequestTimeout == 0 {
p.RequestTimeout = time.Minute
}
if p.InboxSize == 0 {
p.InboxSize = 1024
}
}

// EnableHTTP is true when http server must run.
func (c *Config) EnableHTTP() bool {
return c.Address != ""
Expand Down Expand Up @@ -106,11 +78,6 @@ func (c *Config) InitDefaults() error {
}
c.Pool.InitDefaults()

if c.Proxy == nil {
c.Proxy = &Proxy{}
}
c.Proxy.InitDefaults()

if c.InternalErrorCode == 0 {
c.InternalErrorCode = 500
}
Expand Down Expand Up @@ -157,15 +124,6 @@ func (c *Config) Valid() error {
return errors.E(op, "malformed pool config")
}

if c.Proxy != nil {
if c.Proxy.RequestTimeout < 0 {
return errors.E(op, errors.Str("proxy.request_timeout must be >= 0"))
}
if c.Proxy.InboxSize < 0 {
return errors.E(op, errors.Str("proxy.inbox_size must be >= 0"))
}
}

if !c.EnableHTTP() && !c.EnableTLS() && !c.EnableFCGI() {
return errors.E(op, errors.Str("unable to run http service, no method has been specified (http, https, http/2 or FastCGI)"))
}
Expand Down
55 changes: 26 additions & 29 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,28 @@ module github.com/roadrunner-server/http/v6

go 1.26

toolchain go1.26.4

require (
connectrpc.com/connect v1.20.0
github.com/caddyserver/certmagic v0.25.4
github.com/caddyserver/certmagic v0.25.3
github.com/google/go-cmp v0.7.0
github.com/google/uuid v1.6.0
github.com/mholt/acmez v1.2.0
github.com/prometheus/client_golang v1.23.2
github.com/quic-go/quic-go v0.60.0
github.com/roadrunner-server/api-go/v6 v6.0.0-beta.12
github.com/quic-go/quic-go v0.59.0
github.com/roadrunner-server/api-go/v6 v6.0.0-beta.12.0.20260714200341-93604e5012d4
github.com/roadrunner-server/api-plugins/v6 v6.0.0-beta.2
github.com/roadrunner-server/context v1.3.0
github.com/roadrunner-server/endure/v2 v2.6.2
github.com/roadrunner-server/errors v1.5.0
github.com/roadrunner-server/goridge/v4 v4.0.0-beta.2.0.20260714195909-75e9ece43063
github.com/roadrunner-server/pool/v2 v2.0.0-beta.1
github.com/roadrunner-server/tcplisten v1.5.2
github.com/stretchr/testify v1.11.1
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0
go.opentelemetry.io/contrib/propagators/jaeger v1.44.0
go.opentelemetry.io/otel v1.44.0
go.opentelemetry.io/otel/trace v1.44.0
golang.org/x/net v0.56.0
golang.org/x/sys v0.46.0
google.golang.org/genproto v0.0.0-20260630182238-925bb5da69e7
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.68.0
go.opentelemetry.io/contrib/propagators/jaeger v1.43.0
go.opentelemetry.io/otel v1.43.0
go.opentelemetry.io/otel/trace v1.43.0
golang.org/x/net v0.54.0
golang.org/x/sys v0.44.0
google.golang.org/genproto v0.0.0-20260504160031-60b97b32f348
google.golang.org/protobuf v1.36.11
)

Expand All @@ -35,39 +32,39 @@ require (
github.com/caddyserver/zerossl v0.1.5 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/felixge/httpsnoop v1.1.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/klauspost/cpuid/v2 v2.4.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/libdns/libdns v1.1.1 // indirect
github.com/mholt/acmez/v3 v3.1.6 // indirect
github.com/miekg/dns v1.1.72 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.69.0 // indirect
github.com/prometheus/procfs v0.21.1 // indirect
github.com/prometheus/common v0.67.5 // indirect
github.com/prometheus/procfs v0.20.1 // indirect
github.com/quic-go/qpack v0.6.0 // indirect
github.com/roadrunner-server/events v1.0.1 // indirect
github.com/roadrunner-server/goridge/v4 v4.0.0-beta.2 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/tklauser/go-sysconf v0.4.0 // indirect
github.com/tklauser/numcpus v0.12.0 // indirect
github.com/tklauser/go-sysconf v0.3.16 // indirect
github.com/tklauser/numcpus v0.11.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
github.com/zeebo/blake3 v0.2.4 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/otel/metric v1.44.0 // indirect
go.opentelemetry.io/otel/metric v1.43.0 // indirect
go.uber.org/mock v0.6.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.28.0 // indirect
go.uber.org/zap/exp v0.3.0 // indirect
golang.org/x/crypto v0.53.0 // indirect
golang.org/x/mod v0.37.0 // indirect
golang.org/x/sync v0.21.0 // indirect
golang.org/x/text v0.38.0 // indirect
golang.org/x/tools v0.47.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260630182238-925bb5da69e7 // indirect
google.golang.org/grpc v1.82.0 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect
golang.org/x/crypto v0.51.0 // indirect
golang.org/x/mod v0.36.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/text v0.37.0 // indirect
golang.org/x/tools v0.45.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading