Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Сluster breaks connection.clientAddress #39

Open
artpolikarpov opened this issue Apr 5, 2015 · 7 comments
Open

Сluster breaks connection.clientAddress #39

artpolikarpov opened this issue Apr 5, 2015 · 7 comments

Comments

@artpolikarpov
Copy link

When I turn on cluster package connection.clientAddress becomes 127.0.0.1. How to fix that?

@arunoda
Copy link
Member

arunoda commented Apr 5, 2015

That's because sometimes cluster proxy requests. You can get the client address with following header.

  • x-forwarded-for

@artpolikarpov
Copy link
Author

I know about x-forwarded-for. But I get no x-forwarded-for property in connection.httpHeaders object. :(

That’s all I have:

{ host: 'b1.somehost.io',
'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36',
'accept-language': 'ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4' } }

@arunoda
Copy link
Member

arunoda commented Apr 5, 2015

I think, may be meteor is filtering out some headers. I could get this the raw WS connection?

@artpolikarpov
Copy link
Author

How to check the raw connection? Now I just console.log(this.connection) inside a method on the server.

@arunoda
Copy link
Member

arunoda commented Apr 5, 2015

There is no way to get it from meteor's APIs. May be better to ask how to access x-forwarded-for from the meteor's issue list.
I also found this behaviour.

@artpolikarpov
Copy link
Author

I believe when my app was behind really proxy (like CloudFlare), x-forwarded-for were in connection.httpHeaders.

What do you think about this package https://github.com/gadicc/meteor-headers? Can it be helpful?

@arunoda
Copy link
Member

arunoda commented Apr 5, 2015

If so, this seems like a bug. I can look at it.
I havn't used this package.

On Mon, Apr 6, 2015 at 1:16 AM Artem Polikarpov [email protected]
wrote:

I believe when my app was behind really proxy (like CloudFlare),
x-forwarded-for were in connection.httpHeaders.

What do you think about this package
https://github.com/gadicc/meteor-headers? Can it be helpful?


Reply to this email directly or view it on GitHub
#39 (comment).

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

No branches or pull requests

2 participants