-
Notifications
You must be signed in to change notification settings - Fork 40
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
wss:// protocol websocket connections cannot be intercepted #133
Comments
Is there a specific error you are seeing? |
There is no error. I debugged it and found that it was not intercepted. Do you know why? Normal https requests can be intercepted. |
Core as follow: let proxy with_websocket_handler, implements handle_message and handle_websocket.Then mobile phone initiates a websocket request, which can be simulated using this website(echo.websocket.org),you will find that no relevant logs are printed.However, python mitmproxy can do it.
|
It looks like you are incorrectly implementing |
Remove the implementing handle_websocket, still not working.
|
Could you also share your |
|
Is |
The problem has been identified: for ws(s) requests in the backend interface that require login verification, the package cannot be captured (log printing), while for those that do not require login verification, the package can be printed normally.Do you know why? Thank you very much for your support. |
I'm not sure what you mean by login verification, can you clarify? |
This means that the request header will contain Auth, such as Bear xxxx. |
Thanks, could you also confirm what features you have enabled? If possible, could you also provide an example of a website where you are seeing the issue? |
This is our privately deployed backend service, using golang's gin. Sorry, no online tools have been found to reproduce this issue. |
No worries, and I assume the |
Yes, the authentication information is sent along with the ws request header, such as Authorization:"Bear xxxxx" |
Or to be more precise, ws carries the header information before establishing a connection, and the header cannot be carried during the actual ws interaction process. |
I have spent some time looking into this and have not been able to replicate the issue. I thought that maybe the if hyper_tungstenite::is_upgrade_request(&req) {
if req.headers().get(AUTHORIZATION).is_none_or(|v| v != "password") {
return Ok(Response::builder()
.status(StatusCode::UNAUTHORIZED)
.body(Body::empty())
.unwrap());
}
// spawn handler
} Could you also confirm that the domain the WebSocket connection is being established with is included in your |
Hi, I'm using hudsucker to make a small tool similar to Charles. I found that it seems unable to proxy the websocket connection of the wss:// protocol. I implemented the handle_message method for WebSocketHandler, but it was not executed.
The text was updated successfully, but these errors were encountered: