-
Notifications
You must be signed in to change notification settings - Fork 177
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
Logger/middleware for rpc client? #972
Comments
Hey! IIRC the client should log the requests and responses. |
Yes, as @lexnv said run You could even subscribe to certain Further, we have no middleware for the clients but I think it should be rather trivial to add |
Thanks for the help. However, I'm still not seeing the HTTP response body. Here is my code and the output: https://gist.github.com/allquixotic/f1b02d7e674cdd4abd72b46cb9ff2d57 I should add that the request body displayed in the trace looks good, and if I issue that request body manually, I get a 200 OK response with a |
jsonrpsee isn't logging the HTTP request and response so that's the reason why you can't find it. I did re-run your app with logging the request and the URI looks good:
I have no idea why the HTTP request fails but I guess bad username/password (the HTTP library we use doesn't return response body on failures) |
That's unfortunate. Since I can't figure out what error the server is giving me, I'm not sure how to proceed. I'm certain my credentials are correct, and the request looks good, so I need to be able to fully see the HTTP layer of the stack. I've gotten this to work during some prototyping sessions in Python, so I know the json request body looks good. I'm going to have to put my use of Rust on hold due to this problem and probably switch my project over to Kotlin where better debugging info is available. Thanks for the help. |
Sorry to hear, is the python prototype public somewhere so I can try it? Let me investigate if we provide that debugging info somehow ^^ EDIT: I was wrong it jsonrpsee's fault we throw away the message if
The error response seems to trigger some firewall rule in cloudflare.... ok then let's add this |
Also, independent of you guys doing any work on jsonrpsee to make this better, I added HTTP proxy support to jsonrpsee. See: #975 This helps me debug the raw payload :) |
Now I have the raw payload, working sourcecode in Python, and broken sourcecode in Rust, and I still can't figure out what jsonrpsee is doing "wrong" to cause the Enjin server to throw an error. Anyone have any idea from this? https://gist.github.com/allquixotic/34c36951c4ba19dd47882e77a0f06d23 |
This fixed my jsonrpsee usage:
|
Closing this because middleware has been added to the HTTP client in #981. I have looked at the websocket client as well but looks tricky as we have no access to that in the websocket transport library. |
I have a client class generated using the rpc macro. How can I use logger/middleware with this to see the contents of all HTTP responses, even those from failed requests that generated an Error?
The text was updated successfully, but these errors were encountered: