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

ws 的 RemoteAddr() 丢失了http相关的信息 反向代理无法获取客户端IP #105

Open
kerwin-spec opened this issue Oct 24, 2023 · 0 comments
Labels

Comments

@kerwin-spec
Copy link

要获取client的真实地址,只能在 websocket 的 upgrade 阶段

需要直接重写覆盖 node 的 StartUp方法
https://github.com/lonng/nano/blob/master/interface.go#L57
不改nano的方式,就是重写Listen,Listen内部调用自己的node.Startup(), 自己的node可以继承(组合)nano.Node, 覆写 Startup 方法

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant