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

onBeforeInvoke userdata无效,userdata什么条件下可用? #18

Open
OliverZou opened this issue Jan 22, 2018 · 4 comments
Open

onBeforeInvoke userdata无效,userdata什么条件下可用? #18

OliverZou opened this issue Jan 22, 2018 · 4 comments

Comments

@OliverZou
Copy link

No description provided.

@OliverZou
Copy link
Author

有什么办法从客户端向服务器端不通过rpc api的参数传递一个data?就像http中post可以携带一个header变量Authorization实现认证。

@OliverZou
Copy link
Author

查了源码,context和userdata都和想象的不一样,文档也没有足够清楚。简单扩展一下可以解决问题。解决rpc中的auth2认证问题。

@andot
Copy link
Member

andot commented Jan 25, 2018

context 和 userdata 在服务器端和客户端都是独立的,并不会跨客户端和服务器端传递,如果需要传递数据从客户端到服务器端,你需要自己编写 invokeHandler 来自己附加参数。

@andot
Copy link
Member

andot commented Feb 26, 2019

Hprose 3.0 for TypeScript 出来了。完全可以代替 Hprose for Nodejs 版本。Hprose 3.0 提供了独立于传输协议的 requestHeaders 和 responseHeaders,通过它你就可以在服务器和客户端之间传递额外的数据了。

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