@@ -56,6 +56,7 @@ import (
56
56
"github.com/coder/coder/coderd/devtunnel"
57
57
"github.com/coder/coder/coderd/gitsshkey"
58
58
"github.com/coder/coder/coderd/httpapi"
59
+ "github.com/coder/coder/coderd/httpmw"
59
60
"github.com/coder/coder/coderd/prometheusmetrics"
60
61
"github.com/coder/coder/coderd/telemetry"
61
62
"github.com/coder/coder/coderd/tracing"
@@ -321,6 +322,11 @@ func Server(dflags *codersdk.DeploymentFlags, newAPI func(context.Context, *code
321
322
}
322
323
}
323
324
325
+ realIPConfig , err := httpmw .ParseRealIPConfig (dflags .ProxyTrustedHeaders .Value , dflags .ProxyTrustedOrigins .Value )
326
+ if err != nil {
327
+ return xerrors .Errorf ("parse real ip config: %w" , err )
328
+ }
329
+
324
330
options := & coderd.Options {
325
331
AccessURL : accessURLParsed ,
326
332
AppHostname : appHostname ,
@@ -332,6 +338,7 @@ func Server(dflags *codersdk.DeploymentFlags, newAPI func(context.Context, *code
332
338
CacheDir : dflags .CacheDir .Value ,
333
339
GoogleTokenValidator : googleTokenValidator ,
334
340
SecureAuthCookie : dflags .SecureAuthCookie .Value ,
341
+ RealIPConfig : realIPConfig ,
335
342
SSHKeygenAlgorithm : sshKeygenAlgorithm ,
336
343
TracerProvider : tracerProvider ,
337
344
Telemetry : telemetry .NewNoop (),
0 commit comments