Skip to content

Conversation

@bohanwood
Copy link
Contributor

Because we need the client IP.
Even if X-Forwarded-For or X-Real-IP header can be used,
it's important to use the REMOTE_ADDR to determine whether
the request comes from a trusted edge server/proxy.

@dominikzogg
Copy link
Member

Hello @bohanyang

Thank you for your PR.

Have you checked if there is no way getting this information from the workerman request itself?
I ask, cause this is a BC, means merging an release this change will mean to release a new major version.

Regards Dominik

@bohanwood
Copy link
Contributor Author

@dominikzogg

Yeah, it has to cause a BC break since the WorkermanRequest contains no information beyond HTTP header lines and body.

I've updated the parameter order according to your suggestion.

@dominikzogg
Copy link
Member

@bohanwood
Copy link
Contributor Author

Version updated

@dominikzogg
Copy link
Member

@bohanyang sorry, i should have been more precise, version needs to be 2.0

@bohanwood
Copy link
Contributor Author

Oh sorry it's a major version update, my fault.
Updated

@bohanwood bohanwood changed the title Create PSR request with server params (REMOTE_ADDR) BC: Add server params (REMOTE_ADDR) to PSR request Jul 4, 2022
@dominikzogg
Copy link
Member

@bohanyang it seems that the CI doesn't get started on the CI, have you run the tests locally? I guess the OnMessageTest should fail.

@bohanwood
Copy link
Contributor Author

Tests will pass now.

@dominikzogg dominikzogg merged commit 1a19d31 into chubbyphp:master Jul 4, 2022
@dominikzogg
Copy link
Member

@bohanyang thanks for your contribution

@dominikzogg
Copy link
Member

@bohanwood bohanwood deleted the remote-addr branch November 4, 2022 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants