Does the proxy_ip_parser
not work with IPv6 addresses properly?
#1516
-
Dear Colleagues, I have the proxy_ip_parser enabled in roadrunner 2.12.3 http:
address: 0.0.0.0:8060
middleware: ["http_metrics", "headers", "gzip", "proxy_ip_parser"] I have noticed a problem: when the Is it a possible bug or some misconfiguration on my part? A sample log entry with IPv6:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 29 replies
-
Hey @victor-sudakov 👋🏻 |
Beta Was this translation helpful? Give feedback.
-
Hello @rustatian We use RR to launch Laravel app. I added error_log() into "vendor/spiral/roadrunner-http/src/HttpWorker.php" Result with IPv4: {
"remoteAddr": "X.X.196.87",
"protocol": "HTTP/1.1",
"method": "GET",
"uri": "http://SITE.com/",
"headers": {
"Cf-Connecting-Ip": [
"X.X.196.87"
],
"X-Scheme": [
"https"
],
"User-Agent": [
"curl/7.87.0"
],
"X-Request-Id": [
"899100e44f1f6d7da07580165192b934"
],
"X-Real-Ip": [
"X.X.196.87"
],
"X-Forwarded-For": [
"X.X.196.87"
],
"X-Forwarded-Scheme": [
"https"
],
"Cf-Visitor": [
"{\"scheme\":\"https\"}"
],
"X-Forwarded-Host": [
"SITE.com"
],
"X-Forwarded-Proto": [
"https"
],
"X-Original-Forwarded-For": [
"X.X.196.87"
],
"Accept": [
"*/*"
],
"Cf-Ipcountry": [
"RU"
],
"X-Forwarded-Port": [
"443"
],
"Accept-Encoding": [
"gzip"
],
"Cf-Ray": [
"7aed6de6aba12de4-DME"
],
"Cdn-Loop": [
"cloudflare"
]
},
"cookies": {},
"rawQuery": "",
"parsed": false,
"uploads": null,
"attributes": {}
} Result with IPv6: {
"remoteAddr": "",
"protocol": "HTTP/1.1",
"method": "GET",
"uri": "http://SITE.com/",
"headers": {
"Cf-Connecting-Ip": [
"2001:19f0:5001:21dc::10"
],
"X-Scheme": [
"https"
],
"User-Agent": [
"curl/7.87.0"
],
"X-Request-Id": [
"2af82c002779440ff68431b5e9ac3fd7"
],
"X-Real-Ip": [
"2001:19f0:5001:21dc::10"
],
"X-Forwarded-For": [
"2001:19f0:5001:21dc::10"
],
"X-Forwarded-Scheme": [
"https"
],
"Cf-Visitor": [
"{\"scheme\":\"https\"}"
],
"X-Forwarded-Host": [
"SITE.com"
],
"X-Forwarded-Proto": [
"https"
],
"X-Original-Forwarded-For": [
"2001:19f0:5001:21dc::10"
],
"Accept": [
"*/*"
],
"Cf-Ipcountry": [
"NL"
],
"X-Forwarded-Port": [
"443"
],
"Accept-Encoding": [
"gzip"
],
"Cf-Ray": [
"7aed6717b818b926-AMS"
],
"Cdn-Loop": [
"cloudflare"
]
},
"cookies": {},
"rawQuery": "",
"parsed": false,
"uploads": null,
"attributes": {}
} As you see "remoteAddr" field is empty in case of IPv6. |
Beta Was this translation helpful? Give feedback.
-
Thank you @vladimir-vv for isolating the issue and suggesting a fix, and @rustatian for implementing it! Now this RR middleware is useful behind CloudFlare with IPv6. |
Beta Was this translation helpful? Give feedback.
-
Sure, RoadRunner works very well behind a Kubernetes ingress. It's ideal to serve Laravel apps. |
Beta Was this translation helpful? Give feedback.
Hello @rustatian
We use RR to launch Laravel app.
"laravel/framework", "version": "v9.52.4"
"spiral/roadrunner-laravel", "version": "v5.11.1"
I added error_log() into "vendor/spiral/roadrunner-http/src/HttpWorker.php"
in function waitRequest() to dump payload.
Result with IPv4: